From 7e24809dc1dbebd7ccc4058c9a7c5ea501dcea24 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 10 Jan 2024 18:41:49 +0000 Subject: [PATCH 1/2] feat: Support for universe_domain docs: Updates to authentication documentation docs: Clarified the nature of auto-generated example code PiperOrigin-RevId: 597041952 Source-Link: https://github.com/googleapis/googleapis/commit/a9e70676103435b7b58a94339f2dc566f25c2f26 Source-Link: https://github.com/googleapis/googleapis-gen/commit/48307b70e013cbd77ca15f0f2673a9f1c2df1d18 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC12NC8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdiNzBlMDEzY2JkNzdjYTE1ZjBmMjY3M2E5ZjFjMmRmMWQxOCJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC12NGJldGExLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdiNzBlMDEzY2JkNzdjYTE1ZjBmMjY3M2E5ZjFjMmRmMWQxOCJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLXYyLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLXYyYmV0YTIvLk93bEJvdC55YW1sIiwiaCI6IjQ4MzA3YjcwZTAxM2NiZDc3Y2ExNWYwZjI2NzNhOWYxYzJkZjFkMTgifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLXYyYmV0YTMvLk93bEJvdC55YW1sIiwiaCI6IjQ4MzA3YjcwZTAxM2NiZDc3Y2ExNWYwZjI2NzNhOWYxYzJkZjFkMTgifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRlbGNvX2F1dG9tYXRpb24tdjEvLk93bEJvdC55YW1sIiwiaCI6IjQ4MzA3YjcwZTAxM2NiZDc3Y2ExNWYwZjI2NzNhOWYxYzJkZjFkMTgifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRlbGNvX2F1dG9tYXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjQ4MzA3YjcwZTAxM2NiZDc3Y2ExNWYwZjI2NzNhOWYxYzJkZjFkMTgifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRleHRfdG9fc3BlZWNoLXYxLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRleHRfdG9fc3BlZWNoLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6IjQ4MzA3YjcwZTAxM2NiZDc3Y2ExNWYwZjI2NzNhOWYxYzJkZjFkMTgifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRleHRfdG9fc3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRwdS12MS8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdiNzBlMDEzY2JkNzdjYTE1ZjBmMjY3M2E5ZjFjMmRmMWQxOCJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRwdS8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdiNzBlMDEzY2JkNzdjYTE1ZjBmMjY3M2E5ZjFjMmRmMWQxOCJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYWNlLXYxLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYWNlLXYyLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYW5zbGF0ZS12My8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdiNzBlMDEzY2JkNzdjYTE1ZjBmMjY3M2E5ZjFjMmRmMWQxOCJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYW5zbGF0ZS8uT3dsQm90LnlhbWwiLCJoIjoiNDgzMDdiNzBlMDEzY2JkNzdjYTE1ZjBmMjY3M2E5ZjFjMmRmMWQxOCJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpZGVvLWxpdmVfc3RyZWFtLXYxLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpZGVvLWxpdmVfc3RyZWFtLy5Pd2xCb3QueWFtbCIsImgiOiI0ODMwN2I3MGUwMTNjYmQ3N2NhMTVmMGYyNjczYTlmMWMyZGYxZDE4In0= --- .../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 | 3 + .../google-cloud-talent-v4/LICENSE.md | 201 + .../google-cloud-talent-v4/README.md | 144 + .../google-cloud-talent-v4/Rakefile | 201 + .../gapic_metadata.json | 164 + .../google-cloud-talent-v4.gemspec | 37 + .../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 | 855 ++++ .../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 | 794 ++++ .../v4/company_service/rest/service_stub.rb | 357 ++ .../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 | 457 ++ .../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 | 424 ++ .../talent/v4/completion/rest/service_stub.rb | 119 + .../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 | 435 ++ .../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 | 402 ++ .../v4/event_service/rest/service_stub.rb | 120 + .../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 | 1993 +++++++++ .../talent/v4/job_service/credentials.rb | 52 + .../cloud/talent/v4/job_service/operations.rb | 801 ++++ .../cloud/talent/v4/job_service/paths.rb | 88 + .../cloud/talent/v4/job_service/rest.rb | 53 + .../talent/v4/job_service/rest/client.rb | 1897 ++++++++ .../talent/v4/job_service/rest/operations.rb | 895 ++++ .../v4/job_service/rest/service_stub.rb | 657 +++ .../google/cloud/talent/v4/job_service_pb.rb | 85 + .../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 | 843 ++++ .../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 | 782 ++++ .../v4/tenant_service/rest/service_stub.rb | 357 ++ .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/cloud/talent/v4/common.rb | 955 ++++ .../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 | 387 ++ .../google/cloud/talent/v4/histogram.rb | 72 + .../proto_docs/google/cloud/talent/v4/job.rb | 388 ++ .../google/cloud/talent/v4/job_service.rb | 901 ++++ .../google/cloud/talent/v4/tenant.rb | 50 + .../google/cloud/talent/v4/tenant_service.rb | 121 + .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 49 + .../talent/v4/company_service_rest_test.rb | 357 ++ .../cloud/talent/v4/company_service_test.rb | 372 ++ .../cloud/talent/v4/completion_paths_test.rb | 49 + .../cloud/talent/v4/completion_rest_test.rb | 142 + .../google/cloud/talent/v4/completion_test.rb | 137 + .../talent/v4/event_service_paths_test.rb | 37 + .../talent/v4/event_service_rest_test.rb | 137 + .../cloud/talent/v4/event_service_test.rb | 127 + .../talent/v4/job_service_operations_test.rb | 380 ++ .../cloud/talent/v4/job_service_paths_test.rb | 61 + .../cloud/talent/v4/job_service_rest_test.rb | 660 +++ .../cloud/talent/v4/job_service_test.rb | 756 ++++ .../talent/v4/tenant_service_paths_test.rb | 49 + .../talent/v4/tenant_service_rest_test.rb | 356 ++ .../cloud/talent/v4/tenant_service_test.rb | 370 ++ .../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 | 3 + .../google-cloud-talent-v4beta1/LICENSE.md | 201 + .../google-cloud-talent-v4beta1/README.md | 144 + .../google-cloud-talent-v4beta1/Rakefile | 201 + .../gapic_metadata.json | 164 + .../google-cloud-talent-v4beta1.gemspec | 37 + .../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 | 866 ++++ .../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 | 805 ++++ .../company_service/rest/service_stub.rb | 394 ++ .../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 | 463 ++ .../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 | 430 ++ .../v4beta1/completion/rest/service_stub.rb | 126 + .../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 | 436 ++ .../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 | 403 ++ .../event_service/rest/service_stub.rb | 128 + .../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 | 2015 +++++++++ .../talent/v4beta1/job_service/credentials.rb | 52 + .../talent/v4beta1/job_service/operations.rb | 801 ++++ .../cloud/talent/v4beta1/job_service/paths.rb | 146 + .../cloud/talent/v4beta1/job_service/rest.rb | 53 + .../talent/v4beta1/job_service/rest/client.rb | 1919 ++++++++ .../v4beta1/job_service/rest/operations.rb | 895 ++++ .../v4beta1/job_service/rest/service_stub.rb | 733 +++ .../cloud/talent/v4beta1/job_service_pb.rb | 83 + .../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 | 845 ++++ .../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 | 784 ++++ .../tenant_service/rest/service_stub.rb | 357 ++ .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/cloud/talent/v4beta1/common.rb | 951 ++++ .../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 | 400 ++ .../google/cloud/talent/v4beta1/histogram.rb | 74 + .../google/cloud/talent/v4beta1/job.rb | 389 ++ .../cloud/talent/v4beta1/job_service.rb | 886 ++++ .../google/cloud/talent/v4beta1/tenant.rb | 81 + .../cloud/talent/v4beta1/tenant_service.rb | 123 + .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 64 + .../v4beta1/company_service_rest_test.rb | 357 ++ .../talent/v4beta1/company_service_test.rb | 372 ++ .../talent/v4beta1/completion_paths_test.rb | 64 + .../talent/v4beta1/completion_rest_test.rb | 142 + .../cloud/talent/v4beta1/completion_test.rb | 137 + .../v4beta1/event_service_paths_test.rb | 49 + .../talent/v4beta1/event_service_rest_test.rb | 137 + .../talent/v4beta1/event_service_test.rb | 127 + .../v4beta1/job_service_operations_test.rb | 380 ++ .../talent/v4beta1/job_service_paths_test.rb | 79 + .../talent/v4beta1/job_service_rest_test.rb | 662 +++ .../cloud/talent/v4beta1/job_service_test.rb | 755 ++++ .../v4beta1/tenant_service_paths_test.rb | 49 + .../v4beta1/tenant_service_rest_test.rb | 356 ++ .../talent/v4beta1/tenant_service_test.rb | 370 ++ .../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 | 12 + .../google-cloud-talent/AUTHENTICATION.md | 122 + .../google-cloud-talent/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-talent/Gemfile | 6 + .../google-cloud-talent/LICENSE.md | 201 + owl-bot-staging/google-cloud-talent/README.md | 113 + owl-bot-staging/google-cloud-talent/Rakefile | 201 + .../google-cloud-talent.gemspec | 37 + .../lib/google-cloud-talent.rb | 19 + .../lib/google/cloud/talent.rb | 255 ++ .../lib/google/cloud/talent/version.rb | 26 + .../test/google/cloud/talent/client_test.rb | 120 + .../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 | 3 + .../google-cloud-tasks-v2/LICENSE.md | 201 + .../google-cloud-tasks-v2/README.md | 144 + .../google-cloud-tasks-v2/Rakefile | 201 + .../google-cloud-tasks-v2/gapic_metadata.json | 98 + .../google-cloud-tasks-v2.gemspec | 39 + .../lib/google-cloud-tasks-v2.rb | 21 + .../lib/google/cloud/tasks/v2.rb | 45 + .../cloud/tasks/v2/bindings_override.rb | 102 + .../lib/google/cloud/tasks/v2/cloud_tasks.rb | 56 + .../cloud/tasks/v2/cloud_tasks/client.rb | 2203 +++++++++ .../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 | 2073 +++++++++ .../tasks/v2/cloud_tasks/rest/service_stub.rb | 1014 +++++ .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/cloud/tasks/v2/cloudtasks.rb | 375 ++ .../proto_docs/google/cloud/tasks/v2/queue.rb | 376 ++ .../google/cloud/tasks/v2/target.rb | 462 ++ .../proto_docs/google/cloud/tasks/v2/task.rb | 192 + .../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 | 144 + .../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 | 61 + .../cloud/tasks/v2/cloud_tasks_rest_test.rb | 962 ++++ .../google/cloud/tasks/v2/cloud_tasks_test.rb | 1037 +++++ .../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 | 3 + .../google-cloud-tasks-v2beta2/LICENSE.md | 201 + .../google-cloud-tasks-v2beta2/README.md | 144 + .../google-cloud-tasks-v2beta2/Rakefile | 201 + .../gapic_metadata.json | 128 + .../google-cloud-tasks-v2beta2.gemspec | 39 + .../lib/google-cloud-tasks-v2beta2.rb | 21 + .../lib/google/cloud/tasks/v2beta2.rb | 45 + .../cloud/tasks/v2beta2/bindings_override.rb | 102 + .../google/cloud/tasks/v2beta2/cloud_tasks.rb | 56 + .../cloud/tasks/v2beta2/cloud_tasks/client.rb | 2998 +++++++++++++ .../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 | 2736 ++++++++++++ .../v2beta2/cloud_tasks/rest/service_stub.rb | 1315 ++++++ .../cloud/tasks/v2beta2/cloudtasks_pb.rb | 84 + .../tasks/v2beta2/cloudtasks_services_pb.rb | 286 ++ .../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 | 395 ++ .../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 | 222 + .../google/cloud/tasks/v2beta2/cloudtasks.rb | 642 +++ .../google/cloud/tasks/v2beta2/queue.rb | 438 ++ .../google/cloud/tasks/v2beta2/target.rb | 767 ++++ .../google/cloud/tasks/v2beta2/task.rb | 202 + .../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 | 144 + .../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/buffer_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 | 895 ++++ .../tasks/v2beta2/cloud_tasks_paths_test.rb | 61 + .../tasks/v2beta2/cloud_tasks_rest_test.rb | 1246 ++++++ .../cloud/tasks/v2beta2/cloud_tasks_test.rb | 1416 ++++++ .../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 | 3 + .../google-cloud-tasks-v2beta3/LICENSE.md | 201 + .../google-cloud-tasks-v2beta3/README.md | 144 + .../google-cloud-tasks-v2beta3/Rakefile | 201 + .../gapic_metadata.json | 103 + .../google-cloud-tasks-v2beta3.gemspec | 39 + .../lib/google-cloud-tasks-v2beta3.rb | 21 + .../lib/google/cloud/tasks/v2beta3.rb | 45 + .../cloud/tasks/v2beta3/bindings_override.rb | 102 + .../google/cloud/tasks/v2beta3/cloud_tasks.rb | 56 + .../cloud/tasks/v2beta3/cloud_tasks/client.rb | 2339 ++++++++++ .../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 | 2199 +++++++++ .../v2beta3/cloud_tasks/rest/service_stub.rb | 1075 +++++ .../cloud/tasks/v2beta3/cloudtasks_pb.rb | 74 + .../tasks/v2beta3/cloudtasks_services_pb.rb | 220 + .../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 | 395 ++ .../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 | 222 + .../google/cloud/tasks/v2beta3/cloudtasks.rb | 429 ++ .../google/cloud/tasks/v2beta3/queue.rb | 462 ++ .../google/cloud/tasks/v2beta3/target.rb | 720 +++ .../google/cloud/tasks/v2beta3/task.rb | 207 + .../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 | 144 + .../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/buffer_task.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/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 | 695 +++ .../tasks/v2beta3/cloud_tasks_paths_test.rb | 61 + .../tasks/v2beta3/cloud_tasks_rest_test.rb | 1020 +++++ .../cloud/tasks/v2beta3/cloud_tasks_test.rb | 1103 +++++ .../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 | 12 + .../google-cloud-tasks/AUTHENTICATION.md | 122 + .../google-cloud-tasks/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-tasks/Gemfile | 7 + owl-bot-staging/google-cloud-tasks/LICENSE.md | 201 + owl-bot-staging/google-cloud-tasks/README.md | 114 + owl-bot-staging/google-cloud-tasks/Rakefile | 201 + .../google-cloud-tasks.gemspec | 38 + .../lib/google-cloud-tasks.rb | 19 + .../lib/google/cloud/tasks.rb | 120 + .../lib/google/cloud/tasks/version.rb | 26 + .../test/google/cloud/tasks/client_test.rb | 44 + .../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 | 3 + .../LICENSE.md | 201 + .../README.md | 144 + .../google-cloud-telco_automation-v1/Rakefile | 201 + .../gapic_metadata.json | 198 + .../google-cloud-telco_automation-v1.gemspec | 38 + .../lib/google-cloud-telco_automation-v1.rb | 21 + .../lib/google/cloud/telco_automation/v1.rb | 45 + .../telco_automation/v1/bindings_override.rb | 102 + .../google/cloud/telco_automation/v1/rest.rb | 38 + .../telco_automation/v1/telco_automation.rb | 60 + .../v1/telco_automation/client.rb | 3971 +++++++++++++++++ .../v1/telco_automation/credentials.rb | 47 + .../v1/telco_automation/operations.rb | 801 ++++ .../v1/telco_automation/paths.rb | 172 + .../v1/telco_automation/rest.rb | 58 + .../v1/telco_automation/rest/client.rb | 3699 +++++++++++++++ .../v1/telco_automation/rest/operations.rb | 895 ++++ .../v1/telco_automation/rest/service_stub.rb | 2200 +++++++++ .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../telcoautomation/v1/telcoautomation.rb | 1534 +++++++ .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 380 ++ .../v1/telco_automation_paths_test.rb | 109 + .../v1/telco_automation_rest_test.rb | 2072 +++++++++ .../v1/telco_automation_test.rb | 2330 ++++++++++ .../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 | 5 + .../google-cloud-telco_automation/LICENSE.md | 201 + .../google-cloud-telco_automation/README.md | 104 + .../google-cloud-telco_automation/Rakefile | 201 + .../google-cloud-telco_automation.gemspec | 36 + .../lib/google-cloud-telco_automation.rb | 19 + .../lib/google/cloud/telco_automation.rb | 123 + .../google/cloud/telco_automation/version.rb | 26 + .../cloud/telco_automation/client_test.rb | 44 + .../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 | 3 + .../google-cloud-text_to_speech-v1/LICENSE.md | 201 + .../google-cloud-text_to_speech-v1/README.md | 144 + .../google-cloud-text_to_speech-v1/Rakefile | 201 + .../gapic_metadata.json | 42 + .../google-cloud-text_to_speech-v1.gemspec | 37 + .../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 | 514 +++ .../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 | 490 ++ .../v1/text_to_speech/rest/service_stub.rb | 175 + .../text_to_speech_long_audio_synthesize.rb | 56 + .../client.rb | 457 ++ .../credentials.rb | 51 + .../operations.rb | 801 ++++ .../paths.rb | 52 + .../rest.rb | 53 + .../rest/client.rb | 424 ++ .../rest/operations.rb | 895 ++++ .../rest/service_stub.rb | 120 + .../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 | 58 + .../texttospeech/v1/cloud_tts_services_pb.rb | 48 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/cloud/texttospeech/v1/cloud_tts.rb | 278 ++ .../cloud/texttospeech/v1/cloud_tts_lrs.rb | 74 + .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 135 + .../snippets/text_to_speech/list_voices.rb | 47 + .../text_to_speech/synthesize_speech.rb | 47 + .../synthesize_long_audio.rb | 54 + ...h_long_audio_synthesize_operations_test.rb | 380 ++ ...speech_long_audio_synthesize_paths_test.rb | 37 + ..._speech_long_audio_synthesize_rest_test.rb | 140 + ...xt_to_speech_long_audio_synthesize_test.rb | 151 + .../v1/text_to_speech_paths_test.rb | 37 + .../v1/text_to_speech_rest_test.rb | 192 + .../text_to_speech/v1/text_to_speech_test.rb | 187 + .../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 | 3 + .../LICENSE.md | 201 + .../README.md | 144 + .../Rakefile | 201 + .../gapic_metadata.json | 42 + ...oogle-cloud-text_to_speech-v1beta1.gemspec | 37 + .../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 | 516 +++ .../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 | 492 ++ .../text_to_speech/rest/service_stub.rb | 175 + .../text_to_speech_long_audio_synthesize.rb | 56 + .../client.rb | 457 ++ .../credentials.rb | 51 + .../operations.rb | 801 ++++ .../paths.rb | 52 + .../rest.rb | 53 + .../rest/client.rb | 424 ++ .../rest/operations.rb | 895 ++++ .../rest/service_stub.rb | 120 + .../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 | 60 + .../v1beta1/cloud_tts_services_pb.rb | 48 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../cloud/texttospeech/v1beta1/cloud_tts.rb | 313 ++ .../texttospeech/v1beta1/cloud_tts_lrs.rb | 74 + .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 135 + .../snippets/text_to_speech/list_voices.rb | 47 + .../text_to_speech/synthesize_speech.rb | 47 + .../synthesize_long_audio.rb | 54 + ...h_long_audio_synthesize_operations_test.rb | 380 ++ ...speech_long_audio_synthesize_paths_test.rb | 37 + ..._speech_long_audio_synthesize_rest_test.rb | 140 + ...xt_to_speech_long_audio_synthesize_test.rb | 151 + .../v1beta1/text_to_speech_paths_test.rb | 37 + .../v1beta1/text_to_speech_rest_test.rb | 193 + .../v1beta1/text_to_speech_test.rb | 189 + .../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 | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-text_to_speech/CHANGELOG.md | 2 + .../google-cloud-text_to_speech/Gemfile | 6 + .../google-cloud-text_to_speech/LICENSE.md | 201 + .../google-cloud-text_to_speech/README.md | 113 + .../google-cloud-text_to_speech/Rakefile | 201 + .../google-cloud-text_to_speech.gemspec | 37 + .../lib/google-cloud-text_to_speech.rb | 19 + .../lib/google/cloud/text_to_speech.rb | 153 + .../google/cloud/text_to_speech/version.rb | 26 + .../cloud/text_to_speech/client_test.rb | 63 + .../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 | 3 + .../google-cloud-tpu-v1/LICENSE.md | 201 + owl-bot-staging/google-cloud-tpu-v1/README.md | 144 + owl-bot-staging/google-cloud-tpu-v1/Rakefile | 201 + .../google-cloud-tpu-v1/gapic_metadata.json | 73 + .../google-cloud-tpu-v1.gemspec | 38 + .../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 | 1455 ++++++ .../google/cloud/tpu/v1/tpu/credentials.rb | 51 + .../lib/google/cloud/tpu/v1/tpu/operations.rb | 801 ++++ .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/cloud/tpu/v1/cloud_tpu.rb | 518 +++ .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 380 ++ .../google/cloud/tpu/v1/tpu_paths_test.rb | 73 + .../test/google/cloud/tpu/v1/tpu_test.rb | 784 ++++ .../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 | 5 + owl-bot-staging/google-cloud-tpu/LICENSE.md | 201 + owl-bot-staging/google-cloud-tpu/README.md | 130 + owl-bot-staging/google-cloud-tpu/Rakefile | 201 + .../google-cloud-tpu/google-cloud-tpu.gemspec | 36 + .../google-cloud-tpu/lib/google-cloud-tpu.rb | 19 + .../google-cloud-tpu/lib/google/cloud/tpu.rb | 117 + .../lib/google/cloud/tpu/version.rb | 26 + .../test/google/cloud/tpu/client_test.rb | 34 + .../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 | 3 + .../google-cloud-trace-v1/LICENSE.md | 201 + .../google-cloud-trace-v1/README.md | 144 + .../google-cloud-trace-v1/Rakefile | 201 + .../google-cloud-trace-v1/gapic_metadata.json | 33 + .../google-cloud-trace-v1.gemspec | 37 + .../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 | 699 +++ .../trace/v1/trace_service/credentials.rb | 53 + .../cloud/trace/v1/trace_service/rest.rb | 55 + .../trace/v1/trace_service/rest/client.rb | 649 +++ .../v1/trace_service/rest/service_stub.rb | 239 + .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../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 | 253 ++ .../cloud/trace/v1/trace_service_test.rb | 264 ++ .../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 | 3 + .../google-cloud-trace-v2/LICENSE.md | 201 + .../google-cloud-trace-v2/README.md | 144 + .../google-cloud-trace-v2/Rakefile | 201 + .../google-cloud-trace-v2/gapic_metadata.json | 28 + .../google-cloud-trace-v2.gemspec | 37 + .../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 | 590 +++ .../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 | 550 +++ .../v2/trace_service/rest/service_stub.rb | 180 + .../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 | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/devtools/cloudtrace/v2/trace.rb | 417 ++ .../google/devtools/cloudtrace/v2/tracing.rb | 40 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 49 + .../cloud/trace/v2/trace_service_rest_test.rb | 204 + .../cloud/trace/v2/trace_service_test.rb | 211 + .../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 | 3 + .../google-cloud-translate-v3/LICENSE.md | 201 + .../google-cloud-translate-v3/README.md | 144 + .../google-cloud-translate-v3/Rakefile | 201 + .../gapic_metadata.json | 118 + .../google-cloud-translate-v3.gemspec | 37 + .../lib/google-cloud-translate-v3.rb | 21 + .../lib/google/cloud/translate/v3.rb | 45 + .../cloud/translate/v3/adaptive_mt_pb.rb | 67 + .../google/cloud/translate/v3/common_pb.rb | 46 + .../lib/google/cloud/translate/v3/rest.rb | 37 + .../cloud/translate/v3/translation_service.rb | 56 + .../v3/translation_service/client.rb | 2680 +++++++++++ .../v3/translation_service/credentials.rb | 52 + .../v3/translation_service/operations.rb | 809 ++++ .../translate/v3/translation_service/paths.rb | 109 + .../translate/v3/translation_service/rest.rb | 53 + .../v3/translation_service/rest/client.rb | 2514 +++++++++++ .../v3/translation_service/rest/operations.rb | 1060 +++++ .../translation_service/rest/service_stub.rb | 1279 ++++++ .../translate/v3/translation_service_pb.rb | 94 + .../v3/translation_service_services_pb.rb | 104 + .../lib/google/cloud/translate/v3/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../google/cloud/translate/v3/adaptive_mt.rb | 327 ++ .../google/cloud/translate/v3/common.rb | 61 + .../cloud/translate/v3/translation_service.rb | 1439 ++++++ .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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.translation.v3.json | 815 ++++ .../adaptive_mt_translate.rb | 47 + .../batch_translate_document.rb | 54 + .../batch_translate_text.rb | 54 + .../create_adaptive_mt_dataset.rb | 47 + .../translation_service/create_glossary.rb | 54 + .../delete_adaptive_mt_dataset.rb | 47 + .../delete_adaptive_mt_file.rb | 47 + .../translation_service/delete_glossary.rb | 54 + .../translation_service/detect_language.rb | 47 + .../get_adaptive_mt_dataset.rb | 47 + .../get_adaptive_mt_file.rb | 47 + .../translation_service/get_glossary.rb | 47 + .../get_supported_languages.rb | 47 + .../import_adaptive_mt_file.rb | 47 + .../list_adaptive_mt_datasets.rb | 51 + .../list_adaptive_mt_files.rb | 51 + .../list_adaptive_mt_sentences.rb | 51 + .../translation_service/list_glossaries.rb | 51 + .../translation_service/translate_document.rb | 47 + .../translation_service/translate_text.rb | 47 + .../v3/translation_service_operations_test.rb | 380 ++ .../v3/translation_service_paths_test.rb | 73 + .../v3/translation_service_rest_test.rb | 1218 +++++ .../translate/v3/translation_service_test.rb | 1394 ++++++ .../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 | 6 + .../google-cloud-translate/LICENSE.md | 201 + .../google-cloud-translate/README.md | 113 + .../google-cloud-translate/Rakefile | 201 + .../google-cloud-translate.gemspec | 37 + .../lib/google-cloud-translate.rb | 19 + .../lib/google/cloud/translate.rb | 119 + .../lib/google/cloud/translate/version.rb | 26 + .../google/cloud/translate/client_test.rb | 44 + .../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 | 3 + .../LICENSE.md | 201 + .../README.md | 144 + .../Rakefile | 201 + .../gapic_metadata.json | 128 + .../google-cloud-video-live_stream-v1.gemspec | 38 + .../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 | 104 + .../live_stream/v1/livestream_service.rb | 62 + .../v1/livestream_service/client.rb | 2870 ++++++++++++ .../v1/livestream_service/credentials.rb | 49 + .../v1/livestream_service/operations.rb | 803 ++++ .../v1/livestream_service/paths.rb | 185 + .../live_stream/v1/livestream_service/rest.rb | 60 + .../v1/livestream_service/rest/client.rb | 2694 +++++++++++ .../v1/livestream_service/rest/operations.rb | 897 ++++ .../livestream_service/rest/service_stub.rb | 1369 ++++++ .../google/cloud/video/live_stream/v1/rest.rb | 40 + .../cloud/video/live_stream/v1/version.rb | 30 + .../cloud/video/livestream/v1/outputs_pb.rb | 66 + .../cloud/video/livestream/v1/resources_pb.rb | 96 + .../cloud/video/livestream/v1/service_pb.rb | 84 + .../livestream/v1/service_services_pb.rb | 97 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 395 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 + .../cloud/video/livestream/v1/outputs.rb | 509 +++ .../cloud/video/livestream/v1/resources.rb | 813 ++++ .../cloud/video/livestream/v1/service.rb | 684 +++ .../google/longrunning/operations.rb | 164 + .../proto_docs/google/protobuf/any.rb | 144 + .../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 | 99 + .../snippets/Gemfile | 32 + .../livestream_service/create_asset.rb | 54 + .../livestream_service/create_channel.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_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_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 + .../livestream_service/list_events.rb | 51 + .../livestream_service/list_inputs.rb | 51 + .../livestream_service/start_channel.rb | 54 + .../livestream_service/stop_channel.rb | 54 + .../livestream_service/update_channel.rb | 54 + .../livestream_service/update_input.rb | 54 + .../livestream_service/update_pool.rb | 54 + ...data_google.cloud.video.livestream.v1.json | 895 ++++ .../v1/livestream_service_operations_test.rb | 380 ++ .../v1/livestream_service_paths_test.rb | 121 + .../v1/livestream_service_rest_test.rb | 1311 ++++++ .../live_stream/v1/livestream_service_test.rb | 1513 +++++++ .../test/helper.rb | 25 + .../google-cloud-video-live_stream/.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 39 + .../google-cloud-video-live_stream/.toys.rb | 28 + .../google-cloud-video-live_stream/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-video-live_stream/Gemfile | 5 + .../google-cloud-video-live_stream/LICENSE.md | 201 + .../google-cloud-video-live_stream/README.md | 104 + .../google-cloud-video-live_stream/Rakefile | 201 + .../google-cloud-video-live_stream.gemspec | 36 + .../lib/google-cloud-video-live_stream.rb | 19 + .../lib/google/cloud/video/live_stream.rb | 125 + .../google/cloud/video/live_stream/version.rb | 28 + .../cloud/video/live_stream/client_test.rb | 44 + .../cloud/video/live_stream/version_test.rb | 26 + .../test/helper.rb | 25 + 1132 files changed, 207603 insertions(+) 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/buffer_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/httpbody.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/buffer_task.rb 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/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/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/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/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/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_glossary.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_glossary.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/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_glossary.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/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_glossaries.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/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/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_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_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_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_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/start_channel.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/update_channel.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 create mode 100644 owl-bot-staging/google-cloud-video-live_stream/.gitignore create mode 100644 owl-bot-staging/google-cloud-video-live_stream/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-video-live_stream/.toys.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream/.yardopts create mode 100644 owl-bot-staging/google-cloud-video-live_stream/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream/Gemfile create mode 100644 owl-bot-staging/google-cloud-video-live_stream/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream/README.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream/Rakefile create mode 100644 owl-bot-staging/google-cloud-video-live_stream/google-cloud-video-live_stream.gemspec create mode 100644 owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream/test/helper.rb 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..4adf7a6fbde8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..a931889649bf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-talent-v4" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-talent-v4" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..958fa9498817 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..8c3e7a303c50 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..87f014156c47 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d902e49c978e --- /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 => e + # 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..943dfc059f5e --- /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 => e + # 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..9cc3235e0612 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3e94a46857db --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb @@ -0,0 +1,855 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..311bea5fc240 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3ab5884f5f12 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d43389afea7a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..f4e03fd42b40 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb @@ -0,0 +1,794 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..2b49ffe71bd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..fe63da15d067 --- /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\x82\xd3\xe4\x93\x02\x36\"+/v4/{parent=projects/*/tenants/*}/companies:\x07\x63ompany\xda\x41\x0eparent,company\x12\x94\x01\n\nGetCompany\x12).google.cloud.talent.v4.GetCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\":\x82\xd3\xe4\x93\x02-\x12+/v4/{name=projects/*/tenants/*/companies/*}\xda\x41\x04name\x12\xba\x01\n\rUpdateCompany\x12,.google.cloud.talent.v4.UpdateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"Z\x82\xd3\xe4\x93\x02>23/v4/{company.name=projects/*/tenants/*/companies/*}:\x07\x63ompany\xda\x41\x13\x63ompany,update_mask\x12\x91\x01\n\rDeleteCompany\x12,.google.cloud.talent.v4.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\":\x82\xd3\xe4\x93\x02-*+/v4/{name=projects/*/tenants/*/companies/*}\xda\x41\x04name\x12\xaa\x01\n\rListCompanies\x12,.google.cloud.talent.v4.ListCompaniesRequest\x1a-.google.cloud.talent.v4.ListCompaniesResponse\"<\x82\xd3\xe4\x93\x02-\x12+/v4/{parent=projects/*/tenants/*}/companies\xda\x41\x06parent\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 => e + # 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..9ce296b28571 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..93523b2bca83 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..54fb13cd63d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb @@ -0,0 +1,457 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..9d28028b4d76 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..af16e7ba47e8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..dfc40dbe31bb --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..476cdd0a63c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb @@ -0,0 +1,424 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..a00d9f27c3da --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..c5168b78f0a5 --- /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 => e + # 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..fb447ac1daff --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..122ca2a7f163 --- /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 => e + # 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..4fcbdf779766 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..855eda2b14de --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb @@ -0,0 +1,435 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..851bd92327bd --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..02c08dfc9594 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..083141623e03 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..23643c66bd67 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb @@ -0,0 +1,402 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..5793a9e7c62e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ClientEvent.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..febe8b16e2d6 --- /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\x82\xd3\xe4\x93\x02>\"./v4/{parent=projects/*/tenants/*}/clientEvents:\x0c\x63lient_event\xda\x41\x13parent,client_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 => e + # 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..9203107295ba --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..e8fca3ff9aa5 --- /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 => e + # 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..b43771376256 --- /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 => e + # 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..85cf3095a1fa --- /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 => e + # 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..f9e2bb8f59c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..2cb1f19aa6d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb @@ -0,0 +1,1993 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4::JobService::Operations] + # + attr_reader :operations_client + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 + # [JobResult][JobOperationResult.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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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) + # 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. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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 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) + # 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. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..273522adb7f8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..937988b200ae --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb @@ -0,0 +1,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..d96a228ddc54 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..b0ed7b98329c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4b26a52c59ae --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb @@ -0,0 +1,1897 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4::JobService::Rest::Operations] + # + attr_reader :operations_client + + # 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # [JobResult][JobOperationResult.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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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) + # 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 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) + # 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..a30150d0bf37 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb @@ -0,0 +1,895 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^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..ad14379ca349 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb @@ -0,0 +1,657 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..a18816c7604d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb @@ -0,0 +1,85 @@ +# 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\"\xd7\x0b\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\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\"\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\"@\x82\xd3\xe4\x93\x02-\"&/v4/{parent=projects/*/tenants/*}/jobs:\x03job\xda\x41\nparent,job\x12\xe1\x01\n\x0f\x42\x61tchCreateJobs\x12..google.cloud.talent.v4.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*\xda\x41\x0bparent,jobs\xca\x41\x31\n\x17\x42\x61tchCreateJobsResponse\x12\x16\x42\x61tchOperationMetadata\x12\x83\x01\n\x06GetJob\x12%.google.cloud.talent.v4.GetJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"5\x82\xd3\xe4\x93\x02(\x12&/v4/{name=projects/*/tenants/*/jobs/*}\xda\x41\x04name\x12\x9d\x01\n\tUpdateJob\x12(.google.cloud.talent.v4.UpdateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"I\x82\xd3\xe4\x93\x02\x31\x32*/v4/{job.name=projects/*/tenants/*/jobs/*}:\x03job\xda\x41\x0fjob,update_mask\x12\xe1\x01\n\x0f\x42\x61tchUpdateJobs\x12..google.cloud.talent.v4.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*\xda\x41\x0bparent,jobs\xca\x41\x31\n\x17\x42\x61tchUpdateJobsResponse\x12\x16\x42\x61tchOperationMetadata\x12\x84\x01\n\tDeleteJob\x12(.google.cloud.talent.v4.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02(*&/v4/{name=projects/*/tenants/*/jobs/*}\xda\x41\x04name\x12\xe3\x01\n\x0f\x42\x61tchDeleteJobs\x12..google.cloud.talent.v4.BatchDeleteJobsRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*\xda\x41\x0cparent,names\xca\x41\x31\n\x17\x42\x61tchDeleteJobsResponse\x12\x16\x42\x61tchOperationMetadata\x12\x9d\x01\n\x08ListJobs\x12\'.google.cloud.talent.v4.ListJobsRequest\x1a(.google.cloud.talent.v4.ListJobsResponse\">\x82\xd3\xe4\x93\x02(\x12&/v4/{parent=projects/*/tenants/*}/jobs\xda\x41\rparent,filter\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 => e + # 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 + 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..b17bdf97d706 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..258ce6428509 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..364697a3a0bf --- /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 => e + # 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..aaa361f7ec6d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ae018a1a28fb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..a0aeb3dd68c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..567f45b026a3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..71cf69f0ea33 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8e44239c5fb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb @@ -0,0 +1,782 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..f02b12385954 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..08e1c3e71fc1 --- /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\"?\x82\xd3\xe4\x93\x02)\"\x1f/v4/{parent=projects/*}/tenants:\x06tenant\xda\x41\rparent,tenant\x12\x85\x01\n\tGetTenant\x12(.google.cloud.talent.v4.GetTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\".\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa8\x01\n\x0cUpdateTenant\x12+.google.cloud.talent.v4.UpdateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"K\x82\xd3\xe4\x93\x02\x30\x32&/v4/{tenant.name=projects/*/tenants/*}:\x06tenant\xda\x41\x12tenant,update_mask\x12\x83\x01\n\x0c\x44\x65leteTenant\x12+.google.cloud.talent.v4.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02!*\x1f/v4/{name=projects/*/tenants/*}\xda\x41\x04name\x12\x98\x01\n\x0bListTenants\x12*.google.cloud.talent.v4.ListTenantsRequest\x1a+.google.cloud.talent.v4.ListTenantsResponse\"0\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{parent=projects/*}/tenants\xda\x41\x06parent\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 => e + # 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..2bc513e2ff1e --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..979a066ca4a8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..9f2c4b47ca9a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb @@ -0,0 +1,955 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Compensation range. + # @!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..07bca824bf6f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..a30342743d8f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..5b6cf0e9a8df --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..415e250f1de6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6ed831f0dd6a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..987748d3196b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb @@ -0,0 +1,387 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 [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. + 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. + # @!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. + 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..dcc1f36b8014 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..1b71e80fa8f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # [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 [LocationType.STREET_ADDRESS][] and the + # second is a [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 [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::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..ca9cd837ef35 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb @@ -0,0 +1,901 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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 + # [JobResult][JobOperationResult.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..62cf1d493004 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4165d1a657e0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..5160138862c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..0d9e1c6995f8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..e3dfd2f9ecda --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..07d77c5d3183 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..dcbd7c6bd3f8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..cdca6505f7cd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..1f146401f2fb --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..86a1bdc2e884 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fd2ea4214115 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b13065ea79d8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5194a5c322b0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8ead9abf6fed --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..7af28897d788 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..420a6572b0df --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b5d242f9eb2c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1da8f1a05334 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1c6deeefa6f9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ca1249903d11 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..76184e0e2c44 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1a0d85390aa8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c708cce0b531 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0394f61d2543 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3025eb8d219c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..68676630eb46 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..aefa4dfede93 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0d8496263412 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4f5385751409 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..da69aff3321c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..736e3b8d9cd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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..cd146ed9d2ea --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..c9aeca65e0cb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb @@ -0,0 +1,372 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..6f05e616090f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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..4355b2773178 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..9411f7a30bfd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_service_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..6b81587c0e54 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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..12efc940feb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..9a9e44612bb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..b3105de095ec --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..8d3ccba1b83e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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..820fd209daaa --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb @@ -0,0 +1,660 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + + search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 + + search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 + Gapic::Rest::ClientStub.stub :new, nil 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..6f7b3a81665c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb @@ -0,0 +1,756 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 + + 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"] + 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 }) 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 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) 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 }, 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), 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 + + 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"] + 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 }) 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 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) 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 }, 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), 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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..358c63350621 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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..805e040c0919 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb @@ -0,0 +1,356 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..31bf66b62fc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb @@ -0,0 +1,370 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..fa52d4701773 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..1500b971f9d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-talent-v4beta1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-talent-v4beta1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..9073d25b0aa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..044203662536 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..4fc2bf6ce686 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..998b03c93734 --- /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 => e + # 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..f4cde3a7a5a1 --- /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 => e + # 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..0f816d37791c --- /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 => e + # 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..b3a8779825e6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..db8b134f15a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb @@ -0,0 +1,866 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..30a253307b1a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..70bc24aef672 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..7d55dc966ed5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..2c13936322b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb @@ -0,0 +1,805 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..fe7deed0b817 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb @@ -0,0 +1,394 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..48ce26b1a5f8 --- /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\x82\xd3\xe4\x93\x02\x62\"0/v4beta1/{parent=projects/*/tenants/*}/companies:\x01*Z+\"&/v4beta1/{parent=projects/*}/companies:\x01*\xda\x41\x0eparent,company\x12\xcd\x01\n\nGetCompany\x12..google.cloud.talent.v4beta1.GetCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"i\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{name=projects/*/tenants/*/companies/*}Z(\x12&/v4beta1/{name=projects/*/companies/*}\xda\x41\x04name\x12\xed\x01\n\rUpdateCompany\x12\x31.google.cloud.talent.v4beta1.UpdateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"\x82\x01\x82\xd3\xe4\x93\x02r28/v4beta1/{company.name=projects/*/tenants/*/companies/*}:\x01*Z32./v4beta1/{company.name=projects/*/companies/*}:\x01*\xda\x41\x07\x63ompany\x12\xc5\x01\n\rDeleteCompany\x12\x31.google.cloud.talent.v4beta1.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\"i\x82\xd3\xe4\x93\x02\\*0/v4beta1/{name=projects/*/tenants/*/companies/*}Z(*&/v4beta1/{name=projects/*/companies/*}\xda\x41\x04name\x12\xe3\x01\n\rListCompanies\x12\x31.google.cloud.talent.v4beta1.ListCompaniesRequest\x1a\x32.google.cloud.talent.v4beta1.ListCompaniesResponse\"k\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{parent=projects/*/tenants/*}/companiesZ(\x12&/v4beta1/{parent=projects/*}/companies\xda\x41\x06parent\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 => e + # 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..a247d6ec589f --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..36c6d2ada699 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d4bc4a70cbd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb @@ -0,0 +1,463 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..bd98fbefb5be --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..aa4058fb97c3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8ccf53cdef95 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..2f82bb8470ee --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb @@ -0,0 +1,430 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..2eccb41f271a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..072b50f489d1 --- /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 => e + # 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..f0a365aae693 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..3e0e04dcc957 --- /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 => e + # 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..139590521aaf --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..bbea662f500e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb @@ -0,0 +1,436 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..f1221c88f266 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..aa9b5734303f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..65e44b6a204f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..faca2cedaef0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb @@ -0,0 +1,403 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..a71c9edcad9e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ClientEvent.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..3973345eb132 --- /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\x82\xd3\xe4\x93\x02h\"3/v4beta1/{parent=projects/*/tenants/*}/clientEvents:\x01*Z.\")/v4beta1/{parent=projects/*}/clientEvents:\x01*\xda\x41\x13parent,client_event\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 => e + # 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..8186a98c2640 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..098036df6773 --- /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 => e + # 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..528232daf6b9 --- /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 => e + # 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..594408c0aff4 --- /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 => e + # 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..2fa79b24874a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..cf7b406cf736 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb @@ -0,0 +1,2015 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4beta1::JobService::Operations] + # + attr_reader :operations_client + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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::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 and x-goog-user-project headers + metadata[:"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-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? + return 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) + # 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. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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 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) + # 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. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..8f94dca95313 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9858d17bb233 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb @@ -0,0 +1,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..eacabc066977 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..20d4d8e9c5bb --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0c4bb45f9b25 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb @@ -0,0 +1,1919 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4beta1::JobService::Rest::Operations] + # + attr_reader :operations_client + + # 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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::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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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) + # 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 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) + # 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..34c3d15026bc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb @@ -0,0 +1,895 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^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..57b55bb33953 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb @@ -0,0 +1,733 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..6fe2ae9c07d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb @@ -0,0 +1,83 @@ +# 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\"\xbb\x0b\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\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\"\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\x82\xd3\xe4\x93\x02X\"+/v4beta1/{parent=projects/*/tenants/*}/jobs:\x01*Z&\"!/v4beta1/{parent=projects/*}/jobs:\x01*\xda\x41\nparent,job\x12\x9b\x02\n\x0f\x42\x61tchCreateJobs\x12\x33.google.cloud.talent.v4beta1.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchCreate:\x01*\xda\x41\x0bparent,jobs\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\x12\xb7\x01\n\x06GetJob\x12*.google.cloud.talent.v4beta1.GetJobRequest\x1a .google.cloud.talent.v4beta1.Job\"_\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#\x12!/v4beta1/{name=projects/*/jobs/*}\xda\x41\x04name\x12\xca\x01\n\tUpdateJob\x12-.google.cloud.talent.v4beta1.UpdateJobRequest\x1a .google.cloud.talent.v4beta1.Job\"l\x82\xd3\xe4\x93\x02`2//v4beta1/{job.name=projects/*/tenants/*/jobs/*}:\x01*Z*2%/v4beta1/{job.name=projects/*/jobs/*}:\x01*\xda\x41\x03job\x12\x9b\x02\n\x0f\x42\x61tchUpdateJobs\x12\x33.google.cloud.talent.v4beta1.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchUpdate:\x01*\xda\x41\x0bparent,jobs\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\x12\xb3\x01\n\tDeleteJob\x12-.google.cloud.talent.v4beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"_\x82\xd3\xe4\x93\x02R*+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#*!/v4beta1/{name=projects/*/jobs/*}\xda\x41\x04name\x12\xe4\x01\n\x0f\x42\x61tchDeleteJobs\x12\x33.google.cloud.talent.v4beta1.BatchDeleteJobsRequest\x1a\x16.google.protobuf.Empty\"\x83\x01\x82\xd3\xe4\x93\x02m\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*Z/\"-/v4beta1/{parent=projects/*}/jobs:batchDelete\xda\x41\rparent,filter\x12\xd1\x01\n\x08ListJobs\x12,.google.cloud.talent.v4beta1.ListJobsRequest\x1a-.google.cloud.talent.v4beta1.ListJobsResponse\"h\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{parent=projects/*/tenants/*}/jobsZ#\x12!/v4beta1/{parent=projects/*}/jobs\xda\x41\rparent,filter\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 => e + # 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 + 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..c4f78e682c11 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..babfc9227da4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5080a4867c49 --- /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 => e + # 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..f0dc434284d3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6d6de55ac117 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb @@ -0,0 +1,845 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..369df16e9b9e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c8f2df3a59c7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6d2d6a0e6d2b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ce352d7f4d9d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb @@ -0,0 +1,784 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..7d56ab92e31e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..77c332c9020c --- /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\"?\x82\xd3\xe4\x93\x02)\"$/v4beta1/{parent=projects/*}/tenants:\x01*\xda\x41\rparent,tenant\x12\x94\x01\n\tGetTenant\x12-.google.cloud.talent.v4beta1.GetTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"3\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa6\x01\n\x0cUpdateTenant\x12\x30.google.cloud.talent.v4beta1.UpdateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"?\x82\xd3\xe4\x93\x02\x30\x32+/v4beta1/{tenant.name=projects/*/tenants/*}:\x01*\xda\x41\x06tenant\x12\x8d\x01\n\x0c\x44\x65leteTenant\x12\x30.google.cloud.talent.v4beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\"3\x82\xd3\xe4\x93\x02&*$/v4beta1/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa7\x01\n\x0bListTenants\x12/.google.cloud.talent.v4beta1.ListTenantsRequest\x1a\x30.google.cloud.talent.v4beta1.ListTenantsResponse\"5\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{parent=projects/*}/tenants\xda\x41\x06parent\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 => e + # 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..36bca3dac164 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..8a4c987ae10f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..f1c6b139192b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb @@ -0,0 +1,951 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] + # Compensation range. + # @!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..471b0478d561 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..a6f172bc8d0e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..3a70916d17e0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..70ec7dd37186 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6e52913ccde0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..73f96155f69a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!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. + 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..9f13ab009987 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..b65ab47e42d1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8d83d8ed4cc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb @@ -0,0 +1,886 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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..bcdf81580e2b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..867219fb700c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..5160138862c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..0d9e1c6995f8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..e3dfd2f9ecda --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..07d77c5d3183 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..dcbd7c6bd3f8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..2726aed1b15f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..e32b44071cb1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9814f5de3e7a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1b7ceb85ab0b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7716203fd160 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8074bfe1dc7a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..95f073376570 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..98ea7861d207 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c01bb3ff74cb --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5ad0c86b6dc7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ea79991170be --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0510c335749b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a9857529e236 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b18f1d2dd1c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..02e4ccea1de1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3297a5d94715 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5fc9281fa51f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c88d07a68c7a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9a252f88caa8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1277b423319f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..f6058c750c47 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ad9751932c14 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3be917ea99b2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a79fc60d2ebc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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..eac627bf8bee --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..633ff7cd228d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb @@ -0,0 +1,372 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..ab932dd53e0f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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..bf03cd1bba69 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..94df96619d6e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_service_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..cafe78a55342 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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..bfa233ce13d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..014474f91f28 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/talent/v4beta1/event_service_pb" +require "google/cloud/talent/v4beta1/event_service_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..1cb22bbecf93 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..1f66d979761f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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..f236a7418c7e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb @@ -0,0 +1,662 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + + search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 + + search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 + Gapic::Rest::ClientStub.stub :new, nil 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..030340d45923 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb @@ -0,0 +1,755 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 + + 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"] + 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 }) 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 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) 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 }, 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), 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 + + 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"] + 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 }) 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 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) 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 }, 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), 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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..81001d4fabf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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..ddff8830a106 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb @@ -0,0 +1,356 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..29db907e24cc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb @@ -0,0 +1,370 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-talent/.yardopts b/owl-bot-staging/google-cloud-talent/.yardopts new file mode 100644 index 000000000000..6311b6b66212 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Talent Solution 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-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..1b4779f0da9e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-talent-v4", path: "../google-cloud-talent-v4" +gem "google-cloud-talent-v4beta1", path: "../google-cloud-talent-v4beta1" 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..28b03d6a9101 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/README.md @@ -0,0 +1,113 @@ +# 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 +verisoned 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), +[google-cloud-talent-v4beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/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. {file:AUTHENTICATION.md Set up authentication.} + +## Migrating from pre-0.20 versions + +The 0.20 release of the google-cloud-talent 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. + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..356311dba40a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-talent" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-talent" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..e15413e3a3cb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec @@ -0,0 +1,37 @@ +# -*- 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", "MIGRATING.md"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-talent-v4", ">= 0.9", "< 2.a" + gem.add_dependency "google-cloud-talent-v4beta1", ">= 0.7", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +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..61b063159695 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..636e6606024e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb @@ -0,0 +1,255 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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, "jobs.googleapis.com", 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 +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. + # + # ## 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 + + ## + # 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. + # + # ## 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 + + ## + # 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. + # + # ## 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 + + ## + # 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. + # + # ## 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 + + ## + # 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. + # + # ## 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 + + ## + # 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..37adb261913a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..2d75244acff7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_company_service_grpc + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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 + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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 + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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 + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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 + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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..4968c43b28f4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..5c006854efed --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..db4260be85e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks-v2" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks-v2" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..388e8e27656b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec @@ -0,0 +1,39 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + gem.add_dependency "grpc-google-iam-v1", "~> 1.1" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..f23232a26cde --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..9051b8c455e7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7dec9e645f03 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module 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 = Configuration.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 + + ## + # @private + # Configuration class for the google.cloud.tasks.v2 package. + # + # This class contains common configuration for all services + # of the google.cloud.tasks.v2 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..9cd5ecbd97ce --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..aef189d3770a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb @@ -0,0 +1,2203 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @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 + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 + # {::Google::Cloud::Location::Locations::Client#list_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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..5cbb18569c6f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..817654d24d5e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..fcd3552d4ec7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..cd28dec58d7b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb @@ -0,0 +1,2073 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + config.bindings_override = @config.bindings_override + end + + @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 + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # {::Google::Cloud::Location::Locations::Rest::Client#list_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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..0adda575f690 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb @@ -0,0 +1,1014 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..fc6370b20efe --- /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\";\x82\xd3\xe4\x93\x02,\x12*/v2/{parent=projects/*/locations/*}/queues\xda\x41\x06parent\x12\x8b\x01\n\x08GetQueue\x12&.google.cloud.tasks.v2.GetQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"9\x82\xd3\xe4\x93\x02,\x12*/v2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xa0\x01\n\x0b\x43reateQueue\x12).google.cloud.tasks.v2.CreateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"H\x82\xd3\xe4\x93\x02\x33\"*/v2/{parent=projects/*/locations/*}/queues:\x05queue\xda\x41\x0cparent,queue\x12\xab\x01\n\x0bUpdateQueue\x12).google.cloud.tasks.v2.UpdateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"S\x82\xd3\xe4\x93\x02\x39\x32\x30/v2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\xda\x41\x11queue,update_mask\x12\x8b\x01\n\x0b\x44\x65leteQueue\x12).google.cloud.tasks.v2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02,**/v2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\x98\x01\n\nPurgeQueue\x12(.google.cloud.tasks.v2.PurgeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:purge:\x01*\xda\x41\x04name\x12\x98\x01\n\nPauseQueue\x12(.google.cloud.tasks.v2.PauseQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:pause:\x01*\xda\x41\x04name\x12\x9b\x01\n\x0bResumeQueue\x12).google.cloud.tasks.v2.ResumeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"C\x82\xd3\xe4\x93\x02\x36\"1/v2/{name=projects/*/locations/*/queues/*}:resume:\x01*\xda\x41\x04name\x12\x9c\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"Q\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa3\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xce\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"c\x82\xd3\xe4\x93\x02\x46\"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xa3\x01\n\tListTasks\x12\'.google.cloud.tasks.v2.ListTasksRequest\x1a(.google.cloud.tasks.v2.ListTasksResponse\"C\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{parent=projects/*/locations/*/queues/*}/tasks\xda\x41\x06parent\x12\x90\x01\n\x07GetTask\x12%.google.cloud.tasks.v2.GetTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"A\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xa0\x01\n\nCreateTask\x12(.google.cloud.tasks.v2.CreateTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"K\x82\xd3\xe4\x93\x02\x37\"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\xda\x41\x0bparent,task\x12\x91\x01\n\nDeleteTask\x12(.google.cloud.tasks.v2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"A\x82\xd3\xe4\x93\x02\x34*2/v2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\x97\x01\n\x07RunTask\x12%.google.cloud.tasks.v2.RunTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"H\x82\xd3\xe4\x93\x02;\"6/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\xda\x41\x04name\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 => e + # 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..276f3e975372 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..eb67ea374b1a --- /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 => e + # 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..2f78dc35f4e0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b9c42a713c7c --- /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 => e + # 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..d3f316ff7626 --- /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 => e + # 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..9acc7df26768 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..95d6c3993e00 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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..4b9356eee952 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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..7fcecb4742e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!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. + 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..10676fe58d43 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb @@ -0,0 +1,192 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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. + # @!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. + # @!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..3729ce6dfaa5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d762967fa7ec --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..a916fb4322c7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Iam::V1::Binding#members 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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..41c8c3a565cc --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..b6fc1bbc1015 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..499dda879677 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fe34a0cc9079 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3881a91e82d4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..31817ee6c41e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6795a532de95 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..18321fa5b114 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8d8e1cb937ba --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1c73c3e0712d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..351400794e02 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a0d67affce11 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b6cdb2114570 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d009f1ce4a39 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..25dea0517ec3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0e864ecc2c38 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b70a8f44cc86 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..371fed81e7a0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6bd9f43e812d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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..7c5f6b0b02c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb @@ -0,0 +1,962 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..e6b0847739e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb @@ -0,0 +1,1037 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/cloudtasks_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..3d5f2b053ac6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..e72735e95aa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks-v2beta2" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks-v2beta2" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..6dee6ad117ab --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "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" + ] + }, + "BufferTask": { + "methods": [ + "buffer_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..487a46f001a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec @@ -0,0 +1,39 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + gem.add_dependency "grpc-google-iam-v1", "~> 1.1" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..778c2bcbbe6c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..c0e3fb1bea91 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..e4d0e0c9252a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module 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 = Configuration.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 + + ## + # @private + # Configuration class for the google.cloud.tasks.v2beta2 package. + # + # This class contains common configuration for all services + # of the google.cloud.tasks.v2beta2 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..ff99c2c647ee --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b4c28218a21f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb @@ -0,0 +1,2998 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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.rpcs.buffer_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 + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @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 + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 + # {::Google::Cloud::Location::Locations::Client#list_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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates and buffers a new task without the need to explicitly define a Task + # message. The queue must have [HTTP + # target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a + # custom ID, use the following format and set TASK_ID to your desired ID: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer + # To create the task with an automatically generated ID, use the following + # format: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. + # Note: This feature is in its experimental stage. You must request access to + # the API through the [Cloud Tasks BufferTask Experiment Signup + # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). + # + # @overload buffer_task(request, options = nil) + # Pass arguments to `buffer_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::BufferTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload buffer_task(queue: nil, task_id: nil, body: nil) + # Pass arguments to `buffer_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 queue [::String] + # Required. The parent queue name. For example: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task_id [::String] + # Optional. Task ID for the task being created. If not provided, a random + # task ID is assigned to the task. + # @param body [::Google::Api::HttpBody, ::Hash] + # Optional. Body of the HTTP request. + # + # The body can take any generic value. The value is written to the + # [HttpRequest][payload] of the [Task]. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] + # + # @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::BufferTaskRequest.new + # + # # Call the buffer_task method. + # result = client.buffer_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::BufferTaskResponse. + # p result + # + def buffer_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.buffer_task.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.queue + header_params["queue"] = request.queue + end + if request.task_id + header_params["task_id"] = request.task_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.buffer_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.buffer_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :buffer_task, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 + ## + # RPC-specific configuration for `buffer_task` + # @return [::Gapic::Config::Method] + # + attr_reader :buffer_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 + buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task + @buffer_task = ::Gapic::Config::Method.new buffer_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..a8216d057c13 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9c19154afc5e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..b925abd13285 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..25d81d058cdf --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb @@ -0,0 +1,2736 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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.rpcs.buffer_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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + config.bindings_override = @config.bindings_override + end + + @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 + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # {::Google::Cloud::Location::Locations::Rest::Client#list_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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates and buffers a new task without the need to explicitly define a Task + # message. The queue must have [HTTP + # target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a + # custom ID, use the following format and set TASK_ID to your desired ID: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer + # To create the task with an automatically generated ID, use the following + # format: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. + # Note: This feature is in its experimental stage. You must request access to + # the API through the [Cloud Tasks BufferTask Experiment Signup + # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). + # + # @overload buffer_task(request, options = nil) + # Pass arguments to `buffer_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::BufferTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload buffer_task(queue: nil, task_id: nil, body: nil) + # Pass arguments to `buffer_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 queue [::String] + # Required. The parent queue name. For example: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task_id [::String] + # Optional. Task ID for the task being created. If not provided, a random + # task ID is assigned to the task. + # @param body [::Google::Api::HttpBody, ::Hash] + # Optional. Body of the HTTP request. + # + # The body can take any generic value. The value is written to the + # [HttpRequest][payload] of the [Task]. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] + # + # @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::BufferTaskRequest.new + # + # # Call the buffer_task method. + # result = client.buffer_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::BufferTaskResponse. + # p result + # + def buffer_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.buffer_task.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.buffer_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.buffer_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.buffer_task request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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 + ## + # RPC-specific configuration for `buffer_task` + # @return [::Gapic::Config::Method] + # + attr_reader :buffer_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 + buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task + @buffer_task = ::Gapic::Config::Method.new buffer_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..b280eb6d006f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the buffer_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::BufferTaskResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] + # A result object deserialized from the server's reply + def buffer_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_buffer_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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 + + ## + # @private + # + # GRPC transcoding helper method for the buffer_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_buffer_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{queue}/tasks/{task_id}:buffer", + body: "*", + matches: [ + ["queue", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false], + ["task_id", %r{^[^/]+/?$}, 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..5075b1987422 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb @@ -0,0 +1,84 @@ +# 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.View\"\x89\x01\n\x11\x42ufferTaskRequest\x12\x35\n\x05queue\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x14\n\x07task_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\'\n\x04\x62ody\x18\x03 \x01(\x0b\x32\x14.google.api.HttpBodyB\x03\xe0\x41\x01\"D\n\x12\x42ufferTaskResponse\x12.\n\x04task\x18\x01 \x01(\x0b\x32 .google.cloud.tasks.v2beta2.Task2\x8c\x1f\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta2.ListQueuesRequest\x1a..google.cloud.tasks.v2beta2.ListQueuesResponse\"@\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{parent=projects/*/locations/*}/queues\xda\x41\x06parent\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta2.GetQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\">\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta2.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"M\x82\xd3\xe4\x93\x02\x38\"//v2beta2/{parent=projects/*/locations/*}/queues:\x05queue\xda\x41\x0cparent,queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta2.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"X\x82\xd3\xe4\x93\x02>25/v2beta2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\xda\x41\x11queue,update_mask\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\x82\xd3\xe4\x93\x02\x31*//v2beta2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta2.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:purge:\x01*\xda\x41\x04name\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta2.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:pause:\x01*\xda\x41\x04name\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta2.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"H\x82\xd3\xe4\x93\x02;\"6/v2beta2/{name=projects/*/locations/*/queues/*}:resume:\x01*\xda\x41\x04name\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\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\x82\xd3\xe4\x93\x02K\"F/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta2.ListTasksRequest\x1a-.google.cloud.tasks.v2beta2.ListTasksResponse\"H\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks\xda\x41\x06parent\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta2.GetTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"F\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta2.CreateTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"P\x82\xd3\xe4\x93\x02<\"7/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\xda\x41\x0bparent,task\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\x82\xd3\xe4\x93\x02\x39*7/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xcd\x01\n\nLeaseTasks\x12-.google.cloud.tasks.v2beta2.LeaseTasksRequest\x1a..google.cloud.tasks.v2beta2.LeaseTasksResponse\"`\x82\xd3\xe4\x93\x02\x42\"=/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease:\x01*\xda\x41\x15parent,lease_duration\x12\xc2\x01\n\x0f\x41\x63knowledgeTask\x12\x32.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest\x1a\x16.google.protobuf.Empty\"c\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge:\x01*\xda\x41\x12name,schedule_time\x12\xd0\x01\n\nRenewLease\x12-.google.cloud.tasks.v2beta2.RenewLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"q\x82\xd3\xe4\x93\x02G\"B/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease:\x01*\xda\x41!name,schedule_time,lease_duration\x12\xc4\x01\n\x0b\x43\x61ncelLease\x12..google.cloud.tasks.v2beta2.CancelLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"c\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease:\x01*\xda\x41\x12name,schedule_time\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta2.RunTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"M\x82\xd3\xe4\x93\x02@\";/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\xda\x41\x04name\x12\xd4\x01\n\nBufferTask\x12-.google.cloud.tasks.v2beta2.BufferTaskRequest\x1a..google.cloud.tasks.v2beta2.BufferTaskResponse\"g\x82\xd3\xe4\x93\x02L\"G/v2beta2/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer:\x01*\xda\x41\x12queue,task_id,body\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 => e + # 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 + BufferTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.BufferTaskRequest").msgclass + BufferTaskResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.BufferTaskResponse").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..7624ea0dc31f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb @@ -0,0 +1,286 @@ +# 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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + # Creates and buffers a new task without the need to explicitly define a Task + # message. The queue must have [HTTP + # target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a + # custom ID, use the following format and set TASK_ID to your desired ID: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer + # To create the task with an automatically generated ID, use the following + # format: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. + # Note: This feature is in its experimental stage. You must request access to + # the API through the [Cloud Tasks BufferTask Experiment Signup + # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). + rpc :BufferTask, ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse + 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..76f6e97cd499 --- /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 => e + # 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..d3536041d6aa --- /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 => e + # 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..ccdb345175cc --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..908b69603005 --- /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 => e + # 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..5c0c20d849ba --- /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 => e + # 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..f67829e4ad0a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..79b20abe20f9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..cf1a91615d79 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb @@ -0,0 +1,642 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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 + + # LINT.IfChange + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task BufferTask}. + # @!attribute [rw] queue + # @return [::String] + # Required. The parent queue name. For example: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @!attribute [rw] task_id + # @return [::String] + # Optional. Task ID for the task being created. If not provided, a random + # task ID is assigned to the task. + # @!attribute [rw] body + # @return [::Google::Api::HttpBody] + # Optional. Body of the HTTP request. + # + # The body can take any generic value. The value is written to the + # [HttpRequest][payload] of the [Task]. + class BufferTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task BufferTask}. + # @!attribute [rw] task + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # The created task. + class BufferTaskResponse + 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..236aa4e40b70 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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}. + # @!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}. + # @!attribute [rw] http_target + # @return [::Google::Cloud::Tasks::V2beta2::HttpTarget] + # An http_target is used to override the target values for HTTP tasks. + # @!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. + # @!attribute [rw] unlimited_attempts + # @return [::Boolean] + # If true, then the number of attempts is unlimited. + # @!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..375ba3609ebe --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb @@ -0,0 +1,767 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_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::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. + # @!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. + 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 + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_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::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. + # @!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. + 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..18591ba5f790 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb @@ -0,0 +1,202 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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. + # @!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. + # @!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. + # @!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..3729ce6dfaa5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d762967fa7ec --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..a916fb4322c7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Iam::V1::Binding#members 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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..41c8c3a565cc --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..0b2727003216 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..df67053c75e6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/buffer_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb new file mode 100644 index 000000000000..96b2f3a62447 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudtasks_v2beta2_generated_CloudTasks_BufferTask_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the buffer_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#buffer_task. +# +def buffer_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::BufferTaskRequest.new + + # Call the buffer_task method. + result = client.buffer_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::BufferTaskResponse. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_BufferTask_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..4d6aeb569fd5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..86b1ae535f83 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ac3f759e4915 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1582647ac379 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..01c81fe78217 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3677bb879fa6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b411172aed61 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..53e515774e1a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7e0331d4c068 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7b6598466775 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7e01edefaf4a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0e1ea8512fe7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..e6f48d7b96db --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c9abc74a9ed1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..cc97bd8dcdc1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..da755ab3f463 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a803a14af79c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..be83313568b4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a6ef952ba4ca --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6f3f47e7e696 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..df22fb388f74 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json @@ -0,0 +1,895 @@ +{ + "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" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_BufferTask_sync", + "title": "Snippet for the buffer_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task.", + "file": "cloud_tasks/buffer_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "buffer_task", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::BufferTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::BufferTaskResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "BufferTask", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.BufferTask", + "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..9d8a1a121f40 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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..4050d23b0068 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb @@ -0,0 +1,1246 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_buffer_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + queue = "hello world" + task_id = "hello world" + body = {} + + buffer_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_buffer_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.buffer_task queue: queue, task_id: task_id, body: body do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.buffer_task ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.buffer_task({ queue: queue, task_id: task_id, body: body }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.buffer_task(::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, buffer_task_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + Gapic::Rest::ClientStub.stub :new, nil 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..76e6fa069f5e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb @@ -0,0 +1,1416 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/cloudtasks_services_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) + + yield @response, @operation if block_given? + + @response + 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_buffer_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + task_id = "hello world" + body = {} + + buffer_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :buffer_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, request + assert_equal "hello world", request["queue"] + assert_equal "hello world", request["task_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::HttpBody), request["body"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.buffer_task queue: queue, task_id: task_id, body: body do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.buffer_task ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.buffer_task({ queue: queue, task_id: task_id, body: body }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.buffer_task(::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, buffer_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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..4a2a40cfcbda --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..ffd75af209e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks-v2beta3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks-v2beta3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..ca54cdb00142 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json @@ -0,0 +1,103 @@ +{ + "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" + ] + }, + "BufferTask": { + "methods": [ + "buffer_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..43d3204a9f26 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec @@ -0,0 +1,39 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + gem.add_dependency "grpc-google-iam-v1", "~> 1.1" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..c04c6d6cf1da --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..2710ba111326 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d4c001660376 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module 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 = Configuration.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 + + ## + # @private + # Configuration class for the google.cloud.tasks.v2beta3 package. + # + # This class contains common configuration for all services + # of the google.cloud.tasks.v2beta3 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..8c0f22315a81 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..46d78da395a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb @@ -0,0 +1,2339 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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.rpcs.buffer_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 + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @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 + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 + # {::Google::Cloud::Location::Locations::Client#list_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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates and buffers a new task without the need to explicitly define a Task + # message. The queue must have [HTTP + # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a + # custom ID, use the following format and set TASK_ID to your desired ID: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer + # To create the task with an automatically generated ID, use the following + # format: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. + # Note: This feature is in its experimental stage. You must request access to + # the API through the [Cloud Tasks BufferTask Experiment Signup + # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). + # + # @overload buffer_task(request, options = nil) + # Pass arguments to `buffer_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload buffer_task(queue: nil, task_id: nil, body: nil) + # Pass arguments to `buffer_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 queue [::String] + # Required. The parent queue name. For example: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task_id [::String] + # Optional. Task ID for the task being created. If not provided, a random + # task ID is assigned to the task. + # @param body [::Google::Api::HttpBody, ::Hash] + # Optional. Body of the HTTP request. + # + # The body can take any generic value. The value is written to the + # [HttpRequest][payload] of the [Task]. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] + # + # @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::BufferTaskRequest.new + # + # # Call the buffer_task method. + # result = client.buffer_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse. + # p result + # + def buffer_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.buffer_task.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.queue + header_params["queue"] = request.queue + end + if request.task_id + header_params["task_id"] = request.task_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.buffer_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.buffer_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :buffer_task, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 + ## + # RPC-specific configuration for `buffer_task` + # @return [::Gapic::Config::Method] + # + attr_reader :buffer_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 + buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task + @buffer_task = ::Gapic::Config::Method.new buffer_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..09b2ed201bb1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3be982151f96 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..629eec886905 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8dd8dc734b6d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb @@ -0,0 +1,2199 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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.rpcs.buffer_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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + config.bindings_override = @config.bindings_override + end + + @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 + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # {::Google::Cloud::Location::Locations::Rest::Client#list_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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates and buffers a new task without the need to explicitly define a Task + # message. The queue must have [HTTP + # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a + # custom ID, use the following format and set TASK_ID to your desired ID: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer + # To create the task with an automatically generated ID, use the following + # format: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. + # Note: This feature is in its experimental stage. You must request access to + # the API through the [Cloud Tasks BufferTask Experiment Signup + # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). + # + # @overload buffer_task(request, options = nil) + # Pass arguments to `buffer_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload buffer_task(queue: nil, task_id: nil, body: nil) + # Pass arguments to `buffer_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 queue [::String] + # Required. The parent queue name. For example: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task_id [::String] + # Optional. Task ID for the task being created. If not provided, a random + # task ID is assigned to the task. + # @param body [::Google::Api::HttpBody, ::Hash] + # Optional. Body of the HTTP request. + # + # The body can take any generic value. The value is written to the + # [HttpRequest][payload] of the [Task]. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] + # + # @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::BufferTaskRequest.new + # + # # Call the buffer_task method. + # result = client.buffer_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse. + # p result + # + def buffer_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.buffer_task.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.buffer_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.buffer_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.buffer_task request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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 + ## + # RPC-specific configuration for `buffer_task` + # @return [::Gapic::Config::Method] + # + attr_reader :buffer_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 + buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task + @buffer_task = ::Gapic::Config::Method.new buffer_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..0c6d67767994 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb @@ -0,0 +1,1075 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the buffer_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings 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::BufferTaskResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] + # A result object deserialized from the server's reply + def buffer_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_buffer_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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 + + ## + # @private + # + # GRPC transcoding helper method for the buffer_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_buffer_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{queue}/tasks/{task_id}:buffer", + body: "*", + matches: [ + ["queue", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false], + ["task_id", %r{^[^/]+/?$}, 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..4a1b39ed83cc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb @@ -0,0 +1,74 @@ +# 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/httpbody_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/httpbody.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.View\"\x89\x01\n\x11\x42ufferTaskRequest\x12\x35\n\x05queue\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x14\n\x07task_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\'\n\x04\x62ody\x18\x03 \x01(\x0b\x32\x14.google.api.HttpBodyB\x03\xe0\x41\x01\"D\n\x12\x42ufferTaskResponse\x12.\n\x04task\x18\x01 \x01(\x0b\x32 .google.cloud.tasks.v2beta3.Task2\xfc\x17\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta3.ListQueuesRequest\x1a..google.cloud.tasks.v2beta3.ListQueuesResponse\"@\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{parent=projects/*/locations/*}/queues\xda\x41\x06parent\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta3.GetQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\">\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta3.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"M\x82\xd3\xe4\x93\x02\x38\"//v2beta3/{parent=projects/*/locations/*}/queues:\x05queue\xda\x41\x0cparent,queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta3.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"X\x82\xd3\xe4\x93\x02>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:\x05queue\xda\x41\x11queue,update_mask\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta3.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\x82\xd3\xe4\x93\x02\x31*//v2beta3/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta3.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:purge:\x01*\xda\x41\x04name\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta3.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:pause:\x01*\xda\x41\x04name\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta3.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"H\x82\xd3\xe4\x93\x02;\"6/v2beta3/{name=projects/*/locations/*/queues/*}:resume:\x01*\xda\x41\x04name\x12\xa1\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"V\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\x82\xd3\xe4\x93\x02K\"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta3.ListTasksRequest\x1a-.google.cloud.tasks.v2beta3.ListTasksResponse\"H\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks\xda\x41\x06parent\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta3.GetTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"F\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta3.CreateTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"P\x82\xd3\xe4\x93\x02<\"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\xda\x41\x0bparent,task\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta3.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\x82\xd3\xe4\x93\x02\x39*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta3.RunTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"M\x82\xd3\xe4\x93\x02@\";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\xda\x41\x04name\x12\xd4\x01\n\nBufferTask\x12-.google.cloud.tasks.v2beta3.BufferTaskRequest\x1a..google.cloud.tasks.v2beta3.BufferTaskResponse\"g\x82\xd3\xe4\x93\x02L\"G/v2beta3/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer:\x01*\xda\x41\x12queue,task_id,body\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 => e + # 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"], + ["google.api.HttpBody", "google/api/httpbody.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 + BufferTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.BufferTaskRequest").msgclass + BufferTaskResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.BufferTaskResponse").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..4e5bc3cc006b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb @@ -0,0 +1,220 @@ +# 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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + # Creates and buffers a new task without the need to explicitly define a Task + # message. The queue must have [HTTP + # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a + # custom ID, use the following format and set TASK_ID to your desired ID: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer + # To create the task with an automatically generated ID, use the following + # format: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. + # Note: This feature is in its experimental stage. You must request access to + # the API through the [Cloud Tasks BufferTask Experiment Signup + # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). + rpc :BufferTask, ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse + 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..ab6159c90b47 --- /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 => e + # 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..179741504e5b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0e1351992ea7 --- /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 => e + # 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..cfec4c7e04f2 --- /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 => e + # 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..be2310f24f9a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/httpbody.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/httpbody.rb new file mode 100644 index 000000000000..79b20abe20f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/httpbody.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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-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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..fe0e70e3f20f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb @@ -0,0 +1,429 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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 + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task BufferTask}. + # @!attribute [rw] queue + # @return [::String] + # Required. The parent queue name. For example: + # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @!attribute [rw] task_id + # @return [::String] + # Optional. Task ID for the task being created. If not provided, a random + # task ID is assigned to the task. + # @!attribute [rw] body + # @return [::Google::Api::HttpBody] + # Optional. Body of the HTTP request. + # + # The body can take any generic value. The value is written to the + # [HttpRequest][payload] of the [Task]. + class BufferTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task BufferTask}. + # @!attribute [rw] task + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # The created task. + class BufferTaskResponse + 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..85d176202142 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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..02dfd7b1c554 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb @@ -0,0 +1,720 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task 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. + # @!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. + 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. + # @!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. + 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..dc5233a886b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb @@ -0,0 +1,207 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Cloud::Location::Locations::Client#list_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. + # @!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. + # @!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}. + # @!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..3729ce6dfaa5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d762967fa7ec --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..a916fb4322c7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # {::Google::Iam::V1::Binding#members 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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..41c8c3a565cc --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..9daa48b735df --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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/buffer_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb new file mode 100644 index 000000000000..c2f6fd7a7f7a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the buffer_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#buffer_task. +# +def buffer_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::BufferTaskRequest.new + + # Call the buffer_task method. + result = client.buffer_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync] 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..d1d7e22e0da6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..754a1162ccae --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6ffc704edcf6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..765b069dc126 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0abc16d05346 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fe7dbfe3e743 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4dc7e260ce26 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..2b9fb656a9f8 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..82cf271f468c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c67e18bfdbba --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d921625937fa --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c099e253980a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..538226b9cdb4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..885e49d82cab --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..74515e24f3ba --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b26ea7bbc137 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..f77d5c1953f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json @@ -0,0 +1,695 @@ +{ + "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" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync", + "title": "Snippet for the buffer_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task.", + "file": "cloud_tasks/buffer_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "buffer_task", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::BufferTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::BufferTaskResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "BufferTask", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.BufferTask", + "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..3ea039b3e729 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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..0c6daa1e3b07 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb @@ -0,0 +1,1020 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_buffer_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + queue = "hello world" + task_id = "hello world" + body = {} + + buffer_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_buffer_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.buffer_task queue: queue, task_id: task_id, body: body do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.buffer_task ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.buffer_task({ queue: queue, task_id: task_id, body: body }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.buffer_task(::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, buffer_task_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + Gapic::Rest::ClientStub.stub :new, nil 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..fe14fe37bcf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb @@ -0,0 +1,1103 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/cloudtasks_services_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) + + yield @response, @operation if block_given? + + @response + 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_buffer_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + task_id = "hello world" + body = {} + + buffer_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :buffer_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, request + assert_equal "hello world", request["queue"] + assert_equal "hello world", request["task_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::HttpBody), request["body"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.buffer_task queue: queue, task_id: task_id, body: body do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.buffer_task ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.buffer_task({ queue: queue, task_id: task_id, body: body }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.buffer_task(::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, buffer_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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-tasks/.yardopts b/owl-bot-staging/google-cloud-tasks/.yardopts new file mode 100644 index 000000000000..ff82723ba810 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Tasks 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-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..05f79e744816 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/Gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-tasks-v2", path: "../google-cloud-tasks-v2" +gem "google-cloud-tasks-v2beta2", path: "../google-cloud-tasks-v2beta2" +gem "google-cloud-tasks-v2beta3", path: "../google-cloud-tasks-v2beta3" 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..2f2123375fe0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/README.md @@ -0,0 +1,114 @@ +# 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 +verisoned 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), +[google-cloud-tasks-v2beta2](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta2/latest), +[google-cloud-tasks-v2beta3](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta3/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. {file:AUTHENTICATION.md Set up authentication.} + +## Migrating from 1.x versions + +The 2.0 release of the google-cloud-tasks 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. + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..67e85d3ec20c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tasks" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..61278f522aa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec @@ -0,0 +1,38 @@ +# -*- 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", "MIGRATING.md"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-tasks-v2", ">= 0.7", "< 2.a" + gem.add_dependency "google-cloud-tasks-v2beta2", ">= 0.8", "< 2.a" + gem.add_dependency "google-cloud-tasks-v2beta3", ">= 0.9", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +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..26bf69b03682 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3a39646627af --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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, "cloudtasks.googleapis.com", 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 +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. + # + # ## 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 + + ## + # 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..82cd81ffbc1f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d4fd34257c95 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_cloud_tasks_grpc + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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..f400c870a80c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..3eaaa7ba8111 --- /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 5G deployment and management of cloud infrastructure and 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..f2f63b8a4215 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Telco Automation V1 API + +APIs to automate 5G deployment and management of cloud infrastructure and network functions. + +APIs to automate 5G deployment and management of cloud infrastructure and 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..a088dd83277c --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-telco_automation-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-telco_automation-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..8913187de737 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec @@ -0,0 +1,38 @@ +# -*- 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 5G deployment and management of cloud infrastructure and 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 5G deployment and management of cloud infrastructure and 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..870ae2d9acd1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..63b133aa7d88 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..66adf7f5e0d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module 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 = Configuration.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 + + ## + # @private + # Configuration class for the google.cloud.telcoautomation.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.telcoautomation.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..aace0c81ea10 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..68362ce47808 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..dc3c80ff5ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb @@ -0,0 +1,3971 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + + @location_client = Google::Cloud::Location::Locations::Client.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 + ) + 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 + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..df7ded3da42b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1b42070343c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb @@ -0,0 +1,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..5b7e6c590923 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..7ae54635310e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..39bd66d075df --- /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,3699 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + config.bindings_override = @config.bindings_override + 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 + ) + 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 + + # 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 [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse] + # + # @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 and x-goog-user-project headers + call_metadata[:"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-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| + yield result, operation if block_given? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse] + # + # @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 and x-goog-user-project headers + call_metadata[:"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-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| + yield result, operation if block_given? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..6fcf2afc3b57 --- /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,895 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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..694f33353e2d --- /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,2200 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..036b959d4b98 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..f407f2fca306 --- /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*\x9b\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*o\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\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\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/orchestrationClusters\xda\x41\x06parent\x12\xdb\x01\n\x17GetOrchestrationCluster\x12?.google.cloud.telcoautomation.v1.GetOrchestrationClusterRequest\x1a\x35.google.cloud.telcoautomation.v1.OrchestrationCluster\"H\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/orchestrationClusters/*}\xda\x41\x04name\x12\xbe\x02\n\x1a\x43reateOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.CreateOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\x82\xd3\xe4\x93\x02R\"9/v1/{parent=projects/*/locations/*}/orchestrationClusters:\x15orchestration_cluster\xda\x41\x35parent,orchestration_cluster,orchestration_cluster_id\xca\x41)\n\x14OrchestrationCluster\x12\x11OperationMetadata\x12\xf6\x01\n\x1a\x44\x65leteOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.DeleteOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"u\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/orchestrationClusters/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xba\x01\n\x0cListEdgeSlms\x12\x34.google.cloud.telcoautomation.v1.ListEdgeSlmsRequest\x1a\x35.google.cloud.telcoautomation.v1.ListEdgeSlmsResponse\"=\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/edgeSlms\xda\x41\x06parent\x12\xa7\x01\n\nGetEdgeSlm\x12\x32.google.cloud.telcoautomation.v1.GetEdgeSlmRequest\x1a(.google.cloud.telcoautomation.v1.EdgeSlm\";\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/edgeSlms/*}\xda\x41\x04name\x12\xe2\x01\n\rCreateEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.CreateEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"{\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/edgeSlms:\x08\x65\x64ge_slm\xda\x41\x1bparent,edge_slm,edge_slm_id\xca\x41\x1c\n\x07\x45\x64geSlm\x12\x11OperationMetadata\x12\xcf\x01\n\rDeleteEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.DeleteEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"h\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/edgeSlms/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xf1\x01\n\x0f\x43reateBlueprint\x12\x37.google.cloud.telcoautomation.v1.CreateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"y\x82\xd3\xe4\x93\x02S\"F/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:\tblueprint\xda\x41\x1dparent,blueprint,blueprint_id\x12\xf3\x01\n\x0fUpdateBlueprint\x12\x37.google.cloud.telcoautomation.v1.UpdateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"{\x82\xd3\xe4\x93\x02]2P/v1/{blueprint.name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:\tblueprint\xda\x41\x15\x62lueprint,update_mask\x12\xc7\x01\n\x0cGetBlueprint\x12\x34.google.cloud.telcoautomation.v1.GetBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"U\x82\xd3\xe4\x93\x02H\x12\x46/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\xda\x41\x04name\x12\xb9\x01\n\x0f\x44\x65leteBlueprint\x12\x37.google.cloud.telcoautomation.v1.DeleteBlueprintRequest\x1a\x16.google.protobuf.Empty\"U\x82\xd3\xe4\x93\x02H*F/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\xda\x41\x04name\x12\xda\x01\n\x0eListBlueprints\x12\x36.google.cloud.telcoautomation.v1.ListBlueprintsRequest\x1a\x37.google.cloud.telcoautomation.v1.ListBlueprintsResponse\"W\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints\xda\x41\x06parent\x12\xda\x01\n\x10\x41pproveBlueprint\x12\x38.google.cloud.telcoautomation.v1.ApproveBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:approve:\x01*\xda\x41\x04name\x12\xda\x01\n\x10ProposeBlueprint\x12\x38.google.cloud.telcoautomation.v1.ProposeBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:propose:\x01*\xda\x41\x04name\x12\xd7\x01\n\x0fRejectBlueprint\x12\x37.google.cloud.telcoautomation.v1.RejectBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"_\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:reject:\x01*\xda\x41\x04name\x12\xfe\x01\n\x16ListBlueprintRevisions\x12>.google.cloud.telcoautomation.v1.ListBlueprintRevisionsRequest\x1a?.google.cloud.telcoautomation.v1.ListBlueprintRevisionsResponse\"c\x82\xd3\xe4\x93\x02V\x12T/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:listRevisions\xda\x41\x04name\x12\x8e\x02\n\x18SearchBlueprintRevisions\x12@.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsRequest\x1a\x41.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsResponse\"m\x82\xd3\xe4\x93\x02X\x12V/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:searchRevisions\xda\x41\x0cparent,query\x12\x92\x02\n\x19SearchDeploymentRevisions\x12\x41.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsRequest\x1a\x42.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsResponse\"n\x82\xd3\xe4\x93\x02Y\x12W/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:searchRevisions\xda\x41\x0cparent,query\x12\xfe\x01\n\x17\x44iscardBlueprintChanges\x12?.google.cloud.telcoautomation.v1.DiscardBlueprintChangesRequest\x1a@.google.cloud.telcoautomation.v1.DiscardBlueprintChangesResponse\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:discard:\x01*\xda\x41\x04name\x12\xda\x01\n\x14ListPublicBlueprints\x12<.google.cloud.telcoautomation.v1.ListPublicBlueprintsRequest\x1a=.google.cloud.telcoautomation.v1.ListPublicBlueprintsResponse\"E\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/publicBlueprints\xda\x41\x06parent\x12\xc7\x01\n\x12GetPublicBlueprint\x12:.google.cloud.telcoautomation.v1.GetPublicBlueprintRequest\x1a\x30.google.cloud.telcoautomation.v1.PublicBlueprint\"C\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/publicBlueprints/*}\xda\x41\x04name\x12\xf8\x01\n\x10\x43reateDeployment\x12\x38.google.cloud.telcoautomation.v1.CreateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"}\x82\xd3\xe4\x93\x02U\"G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:\ndeployment\xda\x41\x1fparent,deployment,deployment_id\x12\xfa\x01\n\x10UpdateDeployment\x12\x38.google.cloud.telcoautomation.v1.UpdateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"\x7f\x82\xd3\xe4\x93\x02`2R/v1/{deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:\ndeployment\xda\x41\x16\x64\x65ployment,update_mask\x12\xcb\x01\n\rGetDeployment\x12\x35.google.cloud.telcoautomation.v1.GetDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"V\x82\xd3\xe4\x93\x02I\x12G/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}\xda\x41\x04name\x12\xc6\x01\n\x10RemoveDeployment\x12\x38.google.cloud.telcoautomation.v1.RemoveDeploymentRequest\x1a\x16.google.protobuf.Empty\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:remove:\x01*\xda\x41\x04name\x12\xde\x01\n\x0fListDeployments\x12\x37.google.cloud.telcoautomation.v1.ListDeploymentsRequest\x1a\x38.google.cloud.telcoautomation.v1.ListDeploymentsResponse\"X\x82\xd3\xe4\x93\x02I\x12G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments\xda\x41\x06parent\x12\x82\x02\n\x17ListDeploymentRevisions\x12?.google.cloud.telcoautomation.v1.ListDeploymentRevisionsRequest\x1a@.google.cloud.telcoautomation.v1.ListDeploymentRevisionsResponse\"d\x82\xd3\xe4\x93\x02W\x12U/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:listRevisions\xda\x41\x04name\x12\x82\x02\n\x18\x44iscardDeploymentChanges\x12@.google.cloud.telcoautomation.v1.DiscardDeploymentChangesRequest\x1a\x41.google.cloud.telcoautomation.v1.DiscardDeploymentChangesResponse\"a\x82\xd3\xe4\x93\x02T\"O/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:discard:\x01*\xda\x41\x04name\x12\xd8\x01\n\x0f\x41pplyDeployment\x12\x37.google.cloud.telcoautomation.v1.ApplyDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"_\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:apply:\x01*\xda\x41\x04name\x12\x8c\x02\n\x17\x43omputeDeploymentStatus\x12?.google.cloud.telcoautomation.v1.ComputeDeploymentStatusRequest\x1a@.google.cloud.telcoautomation.v1.ComputeDeploymentStatusResponse\"n\x82\xd3\xe4\x93\x02\x61\x12_/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:computeDeploymentStatus\xda\x41\x04name\x12\xed\x01\n\x12RollbackDeployment\x12:.google.cloud.telcoautomation.v1.RollbackDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"n\x82\xd3\xe4\x93\x02U\"P/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:rollback:\x01*\xda\x41\x10name,revision_id\x12\xf9\x01\n\x15GetHydratedDeployment\x12=.google.cloud.telcoautomation.v1.GetHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"l\x82\xd3\xe4\x93\x02_\x12]/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}\xda\x41\x04name\x12\x8c\x02\n\x17ListHydratedDeployments\x12?.google.cloud.telcoautomation.v1.ListHydratedDeploymentsRequest\x1a@.google.cloud.telcoautomation.v1.ListHydratedDeploymentsResponse\"n\x82\xd3\xe4\x93\x02_\x12]/v1/{parent=projects/*/locations/*/orchestrationClusters/*/deployments/*}/hydratedDeployments\xda\x41\x06parent\x12\xc5\x02\n\x18UpdateHydratedDeployment\x12@.google.cloud.telcoautomation.v1.UpdateHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"\xb1\x01\x82\xd3\xe4\x93\x02\x88\x01\x32q/v1/{hydrated_deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:\x13hydrated_deployment\xda\x41\x1fhydrated_deployment,update_mask\x12\x86\x02\n\x17\x41pplyHydratedDeployment\x12?.google.cloud.telcoautomation.v1.ApplyHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"u\x82\xd3\xe4\x93\x02h\"c/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:apply:\x01*\xda\x41\x04name\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 => e + # 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..aeb5a0efe70c --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..90056f14f6b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb @@ -0,0 +1,1534 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!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 + # @!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. + 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 + 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 + 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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..9cadb40237a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..f5d801f26d22 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..e620b8a5ca64 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..59cea929e21f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..837fe06cf6df --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..36b67c4d8b6e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6f1dcd6dbe78 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..12d2dc194b71 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..35705f9966f4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ae9e64e76044 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b208c428f6c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..196fa69fdfff --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..864da2271be7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6ef0069af64d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3255d8db3a9d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6af1f86663cf --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9f77c00cdad4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4909ce6d6196 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..415ed948243a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..73a7f2a58fac --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c180db653ff3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c035226f03c6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..df092d40eac6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a97004f9649d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8a982f2cc617 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fb100b88860f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fbab43d8d357 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..dd383c398357 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b99e110e5360 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d446f9773e2c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6a2cd8035935 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fa0f8aea1ea2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..428fc15287ac --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a21f8914c937 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..85a86a70134d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..496bcdd78c57 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..72b784f02873 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c07ec351fca1 --- /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,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..bdc02b3be5b3 --- /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,109 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_blueprint_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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, nil 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, nil 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, nil 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..6cd32d5d1e2f --- /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,2072 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..703b7e21472d --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb @@ -0,0 +1,2330 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..d4bd6fbbb508 --- /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 5G deployment and management of cloud infrastructure and 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..cbc274ad2142 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-telco_automation-v1", path: "../google-cloud-telco_automation-v1" 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..2e92a4ecc21a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/README.md @@ -0,0 +1,104 @@ +# Ruby Client for the Telco Automation API + +APIs to automate 5G deployment and management of cloud infrastructure and network functions. + +APIs to automate 5G deployment and management of cloud infrastructure and 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 +verisoned 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. {file:AUTHENTICATION.md Set up authentication.} + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..e0ff9d1a9efc --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-telco_automation" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-telco_automation" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..0145d48cd76c --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec @@ -0,0 +1,36 @@ +# -*- 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 5G deployment and management of cloud infrastructure and network functions." + gem.summary = "APIs to automate 5G deployment and management of cloud infrastructure and 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 = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-telco_automation-v1", ">= 0.0", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +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..17636686bd98 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b2d0d5f6d753 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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, "telcoautomation.googleapis.com", 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 +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. + # + # ## 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 + + ## + # 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..8d1cb6d1314a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..3a3fec9698e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_telco_automation_grpc + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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..178450097577 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..d2f418dd31fe --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..1d8dd613e865 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-text_to_speech-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-text_to_speech-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..10c871bc9e1a --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "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" + ] + } + } + } + } + }, + "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..e0eea98306cf --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..a17501aa0570 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..905a5ab8487c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1a99e3a31c46 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..2668f4955469 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..72abc7d8b4c7 --- /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,514 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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) + # 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. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 + + # @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 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..7e50c200d553 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..3f4276a724ab --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..85ac39b7c178 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..48ae0bfbaeb7 --- /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,490 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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) + # 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..9186dfdee93b --- /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,175 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..4a3156429e97 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8781232d9438 --- /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,457 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations] + # + attr_reader :operations_client + + # 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. + # While Long Audio is in preview, SSML is temporarily unsupported. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..60f55f93ef3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..564fd50a52f1 --- /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,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..c6558acdaae7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d70a418c1fc0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..bcd386b1cf69 --- /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,424 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Operations] + # + attr_reader :operations_client + + # 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. + # While Long Audio is in preview, SSML is temporarily unsupported. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..d2d9e1692b5e --- /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,895 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/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..50e05465d07d --- /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,120 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the 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..b1143d02fb32 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..0b3e8d852278 --- /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\x82\xd3\xe4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\xca\x41t\n8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x12\x38google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf2\x01\n com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xf8\x01\x01\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 => e + # 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..6e6f23a1800d --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..4d8d148fbce7 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb @@ -0,0 +1,58 @@ +# 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\"\xe9\x01\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\"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xcb\x01\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\"\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\"1\n\x18SynthesizeSpeechResponse\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*i\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\x32\xb4\x03\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\xda\x41\rlanguage_code\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\x82\xd3\xe4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb8\x02\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xf8\x01\x01\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 => e + # 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 + SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechRequest").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 + SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechResponse").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..3b479bd247ac --- /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,48 @@ +# 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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..442a0e00518f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + + # 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. + class SynthesizeSpeechRequest + 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. + # @!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). + 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 not set, the service will choose a + # voice based on the other parameters such as language_code and gender. + # @!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. + 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, 4.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 > 4.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 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 + + # 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. 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 will be 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 + 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..e3563f0aa863 --- /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,74 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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. + # While Long Audio is in preview, SSML is temporarily unsupported. + # @!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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..e3a5c4645415 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..c4d062c85eea --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json @@ -0,0 +1,135 @@ +{ + "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_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..7d25127802eb --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..e004d3c243cf --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..aaae62c36f77 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..75966e0dc15a --- /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,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..1abf498bb6ea --- /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,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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..0fe953f7caf9 --- /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,140 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..c30defc211be --- /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,151 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..cd74d491e276 --- /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,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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..eb6433db262f --- /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,192 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 = {} + + synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 + Gapic::Rest::ClientStub.stub :new, nil 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..c54ca42d9a65 --- /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,187 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/texttospeech/v1/cloud_tts_services_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) + + yield @response, @operation if block_given? + + @response + 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 = {} + + 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"] + 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 }) 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 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) 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 }, 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), 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_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..f3124466a2c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..e091eb471668 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-text_to_speech-v1beta1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-text_to_speech-v1beta1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..819778e7dde0 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "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" + ] + } + } + } + } + }, + "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..fc8dc5fa7fe9 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..4dc026d78956 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..a99aa6541077 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b50cdc6bd864 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..db51e21b6a19 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..fb3ff0baea01 --- /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,516 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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) + # 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. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 + + # @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 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..30051f69de2a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..da5a1648dd3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..7355d7bcebab --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..47cd4ce0c63f --- /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,492 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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) + # 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..d754a77e757c --- /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,175 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..4bc55714f7f7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..643949b5f7c4 --- /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,457 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations] + # + attr_reader :operations_client + + # 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. + # While Long Audio is in preview, SSML is temporarily unsupported. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..e35774b8d369 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..466187cd7cdd --- /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,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..825ae0d97a58 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..467308bd67e5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7a764257f4d4 --- /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,424 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Operations] + # + attr_reader :operations_client + + # 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. + # While Long Audio is in preview, SSML is temporarily unsupported. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..6429eaeffc13 --- /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,895 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/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..864ec6ecb4e1 --- /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,120 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the 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..1ae30d965fd6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..0729a0017edc --- /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\x82\xd3\xe4\x93\x02\x41\" e + # 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.v1beta1.SynthesisInput", "google/cloud/texttospeech/v1beta1/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 V1beta1 + SynthesizeLongAudioRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeLongAudioRequest").msgclass + SynthesizeLongAudioResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeLongAudioResponse").msgclass + SynthesizeLongAudioMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeLongAudioMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb new file mode 100644 index 000000000000..123f96e1143a --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto for package 'Google.Cloud.TextToSpeech.V1beta1' +# Original file comments: +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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_lrs_pb' + +module Google + module Cloud + module TextToSpeech + module V1beta1 + 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.v1beta1.TextToSpeechLongAudioSynthesize' + + # Synthesizes long form text asynchronously. + rpc :SynthesizeLongAudio, ::Google::Cloud::TextToSpeech::V1beta1::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-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb new file mode 100644 index 000000000000..c6408b1ae715 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/texttospeech/v1beta1/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 = "\n1google/cloud/texttospeech/v1beta1/cloud_tts.proto\x12!google.cloud.texttospeech.v1beta1\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\"N\n\x12ListVoicesResponse\x12\x38\n\x06voices\x18\x01 \x03(\x0b\x32(.google.cloud.texttospeech.v1beta1.Voice\"\x99\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xa0\x03\n\x17SynthesizeSpeechRequest\x12\x45\n\x05input\x18\x01 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInputB\x03\xe0\x41\x02\x12K\n\x05voice\x18\x02 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12I\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfigB\x03\xe0\x41\x02\x12\x66\n\x14\x65nable_time_pointing\x18\x04 \x03(\x0e\x32H.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType\">\n\rTimepointType\x12\x1e\n\x1aTIMEPOINT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSSML_MARK\x10\x01\"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xd5\x01\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\"\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\"\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*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*z\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\x32\xd2\x03\n\x0cTextToSpeech\x12\xa2\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse\"\'\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\xda\x41\rlanguage_code\x12\xcb\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse\">\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd1\x02\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZIcloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb\xf8\x01\x01\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 => e + # 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 + 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 + 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 + 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 + 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..2f8d8b2ccd20 --- /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,48 @@ +# 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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..1f5ab7536c45 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb @@ -0,0 +1,313 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + + # 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. + 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 + + # 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. + # @!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). + 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 not set, the service will choose a + # voice based on the other parameters such as language_code and gender. + # @!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. + 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, 4.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 > 4.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 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 + + # 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. 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 will be 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 + 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..86f8698ef51f --- /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,74 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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. + # While Long Audio is in preview, SSML is temporarily unsupported. + # @!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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..788888bfdb64 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..1c1d19d88767 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -0,0 +1,135 @@ +{ + "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_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..6d83265d8012 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..8508d861767e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..729b57610f24 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..307a7fc4c3ed --- /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,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..1fa4baf2476b --- /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,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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..9cc63bcb9ced --- /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,140 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..49fdf5d63b5f --- /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,151 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..75c8133b1161 --- /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,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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..2ba589c20209 --- /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,193 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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] + + synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 + Gapic::Rest::ClientStub.stub :new, nil 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..e795c4cf0ba4 --- /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,189 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/texttospeech/v1beta1/cloud_tts_services_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) + + yield @response, @operation if block_given? + + @response + 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] + + 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"] + 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 }) 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 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) 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 }, 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), 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_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-text_to_speech/.yardopts b/owl-bot-staging/google-cloud-text_to_speech/.yardopts new file mode 100644 index 000000000000..a1c2cb53fc73 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Text-to-Speech 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-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..2bef4c98b339 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-text_to_speech-v1", path: "../google-cloud-text_to_speech-v1" +gem "google-cloud-text_to_speech-v1beta1", path: "../google-cloud-text_to_speech-v1beta1" 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..037c8d83c362 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/README.md @@ -0,0 +1,113 @@ +# 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 +verisoned 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), +[google-cloud-text_to_speech-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/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. {file:AUTHENTICATION.md Set up authentication.} + +## Migrating from 0.x versions + +The 1.0 release of the google-cloud-text_to_speech 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. + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..256a4a4d2a10 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-text_to_speech" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-text_to_speech" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..096420e42870 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec @@ -0,0 +1,37 @@ +# -*- 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", "MIGRATING.md"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-text_to_speech-v1", ">= 0.9", "< 2.a" + gem.add_dependency "google-cloud-text_to_speech-v1beta1", ">= 0.10", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +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..c474a526b1ea --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6b1e9a46251c --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# 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, "texttospeech.googleapis.com", 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 +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. + # + # ## 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 + + ## + # 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. + # + # ## 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 + + ## + # 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..25315388331b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..1f67eac7b095 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_text_to_speech_grpc + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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 + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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..e7f15e3549ae --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..695ba0d86029 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..af937a791684 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tpu-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tpu-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..73831c0c6e39 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec @@ -0,0 +1,38 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..b72d6fc095cf --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..d636b51e49d9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..e9be05b2c709 --- /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\"\xb4\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\"\xe1\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\"\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\":\x82\xd3\xe4\x93\x02+\x12)/v1/{parent=projects/*/locations/*}/nodes\xda\x41\x06parent\x12\x83\x01\n\x07GetNode\x12#.google.cloud.tpu.v1.GetNodeRequest\x1a\x19.google.cloud.tpu.v1.Node\"8\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/nodes/*}\xda\x41\x04name\x12\xbe\x01\n\nCreateNode\x12&.google.cloud.tpu.v1.CreateNodeRequest\x1a\x1d.google.longrunning.Operation\"i\x82\xd3\xe4\x93\x02\x31\")/v1/{parent=projects/*/locations/*}/nodes:\x04node\xda\x41\x13parent,node,node_id\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xa9\x01\n\nDeleteNode\x12&.google.cloud.tpu.v1.DeleteNodeRequest\x1a\x1d.google.longrunning.Operation\"T\x82\xd3\xe4\x93\x02+*)/v1/{name=projects/*/locations/*/nodes/*}\xda\x41\x04name\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xaf\x01\n\x0bReimageNode\x12\'.google.cloud.tpu.v1.ReimageNodeRequest\x1a\x1d.google.longrunning.Operation\"X\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/nodes/*}:reimage:\x01*\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xa6\x01\n\x08StopNode\x12$.google.cloud.tpu.v1.StopNodeRequest\x1a\x1d.google.longrunning.Operation\"U\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/nodes/*}:stop:\x01*\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xa9\x01\n\tStartNode\x12%.google.cloud.tpu.v1.StartNodeRequest\x1a\x1d.google.longrunning.Operation\"V\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/nodes/*}:start:\x01*\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xca\x01\n\x16ListTensorFlowVersions\x12\x32.google.cloud.tpu.v1.ListTensorFlowVersionsRequest\x1a\x33.google.cloud.tpu.v1.ListTensorFlowVersionsResponse\"G\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*}/tensorflowVersions\xda\x41\x06parent\x12\xb7\x01\n\x14GetTensorFlowVersion\x12\x30.google.cloud.tpu.v1.GetTensorFlowVersionRequest\x1a&.google.cloud.tpu.v1.TensorFlowVersion\"E\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/tensorflowVersions/*}\xda\x41\x04name\x12\xc2\x01\n\x14ListAcceleratorTypes\x12\x30.google.cloud.tpu.v1.ListAcceleratorTypesRequest\x1a\x31.google.cloud.tpu.v1.ListAcceleratorTypesResponse\"E\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/acceleratorTypes\xda\x41\x06parent\x12\xaf\x01\n\x12GetAcceleratorType\x12..google.cloud.tpu.v1.GetAcceleratorTypeRequest\x1a$.google.cloud.tpu.v1.AcceleratorType\"C\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/acceleratorTypes/*}\xda\x41\x04name\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 => e + # 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..16c826c7ca01 --- /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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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..b71e6490b6e2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..dd226193121d --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb @@ -0,0 +1,1455 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + + @location_client = Google::Cloud::Location::Locations::Client.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 + ) + 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 + + # 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "tpu.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..88ab6049e5f9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1ba6d3b8f603 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb @@ -0,0 +1,801 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "tpu.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..774ebeced0c9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..94eeff501329 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..ee22129a995f --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb @@ -0,0 +1,518 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + 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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6f3a56b59c26 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..933a39a603c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..3028e2cb9ca7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..98a06153a32f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4029125836a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..b7d329463885 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..e00627fee3eb --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..40d999018528 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..e0571dc8f04f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5c3f92522b83 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..ca051218bd12 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..203363c52013 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START 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..9842e5d6517e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..89bd8b35a1f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/tpu/v1/tpu" + +class ::Google::Cloud::Tpu::V1::Tpu::ClientPathsTest < Minitest::Test + def test_accelerator_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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..cb9493acc4b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb @@ -0,0 +1,784 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..47e279d30fb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-tpu-v1", path: "../google-cloud-tpu-v1" 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..f98d8c6b72fa --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/README.md @@ -0,0 +1,130 @@ +# 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 +verisoned 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. {file:AUTHENTICATION.md Set up authentication.} + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..2373de8d758d --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tpu" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-tpu" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..829501d5ee68 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec @@ -0,0 +1,36 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-tpu-v1", ">= 0.0", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +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..b5943080caea --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..74344869b867 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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, "tpu.googleapis.com", 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 +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. + # + # ## 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 + + ## + # 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..4b6f0ea48ee4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..81eba210cc4c --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/tpu" +require "gapic/common" +require "gapic/grpc" + +class Google::Cloud::Tpu::ClientConstructionMinitest < Minitest::Test + def test_tpu_grpc + Gapic::ServiceStub.stub :new, :stub 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..79e9c2c5fd0e --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..99d960906acf --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..668c237733b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-trace-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-trace-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..1f336f31aafc --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..702c4bfdd3f7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..1af25612cec3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a9868b44888a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..7885b1ccd020 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..2da1ecc0235e --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb @@ -0,0 +1,699 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..33cb78ba9454 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..09f38056895f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..de1c13e712b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb @@ -0,0 +1,649 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..bb45de89d482 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb @@ -0,0 +1,239 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Trace::V1::ListTracesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Trace::V1::Trace.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_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..4e4559263817 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..85202166bda1 --- /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\x82\xd3\xe4\x93\x02\"\x12 /v1/projects/{project_id}/traces\xda\x41\nproject_id\x12\xab\x01\n\x08GetTrace\x12..google.devtools.cloudtrace.v1.GetTraceRequest\x1a$.google.devtools.cloudtrace.v1.Trace\"I\x82\xd3\xe4\x93\x02-\x12+/v1/projects/{project_id}/traces/{trace_id}\xda\x41\x13project_id,trace_id\x12\x9e\x01\n\x0bPatchTraces\x12\x31.google.devtools.cloudtrace.v1.PatchTracesRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02*2 /v1/projects/{project_id}/traces:\x06traces\xda\x41\x11project_id,traces\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 => e + # 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..92b8210f762e --- /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 2020 Google LLC +# +# Licensed under the Apache License, Version 2.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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..05875cf63041 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..d71d3b0e06ab --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..1cbaad7daba4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a262aa822296 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..13629e305218 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..0d541ceb7f26 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..833f0c589a25 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb @@ -0,0 +1,264 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/devtools/cloudtrace/v1/trace_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..be4bd409a212 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..de43c042c0fd --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-trace-v2" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-trace-v2" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..17a85424605a --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..57b9d364599a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..3e0fe6afd892 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..f02efd739cad --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4fe1f4f5753d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..81ca9a91d9c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb @@ -0,0 +1,590 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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 + ) + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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..a6d016c426a5 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a67d26c1bc75 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..fa6440cc796a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..f6761a94a971 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb @@ -0,0 +1,550 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "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 + 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 + ) + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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..61288170eaf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Trace::V2::Span.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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..ee3315081986 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..70c5277d7d81 --- /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 => e + # 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..ae8ec10cf311 --- /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\"?\x82\xd3\xe4\x93\x02,\"\'/v2/{name=projects/*}/traces:batchWrite:\x01*\xda\x41\nname,spans\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 => e + # 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..2a4ecb7db4f6 --- /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 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..730b4cbefedd --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb @@ -0,0 +1,417 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!attribute [rw] message_event + # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::MessageEvent] + # An event describing a message sent/received between Spans. + 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. + # @!attribute [rw] int_value + # @return [::Integer] + # A 64-bit signed integer. + # @!attribute [rw] bool_value + # @return [::Boolean] + # A Boolean value represented by `true` or `false`. + 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..04657976a99b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..5160138862c2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..92813184036d --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..00f99ba3e105 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..8dfde6c6615c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..19a0ffe3ccd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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..d07772d16b81 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..deb24751ff8a --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/devtools/cloudtrace/v2/tracing_services_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) + + yield @response, @operation if block_given? + + @response + 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 + Gapic::ServiceStub.stub :new, nil 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 +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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..c5cb33c23885 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..6a2b8f7c64b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-translate-v3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-translate-v3" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..e4a8edee8589 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json @@ -0,0 +1,118 @@ +{ + "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" + ] + }, + "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" + ] + }, + "ListGlossaries": { + "methods": [ + "list_glossaries" + ] + }, + "GetGlossary": { + "methods": [ + "get_glossary" + ] + }, + "DeleteGlossary": { + "methods": [ + "delete_glossary" + ] + }, + "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" + ] + } + } + } + } + } + } +} 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..24133f499d21 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..c617e7ce1216 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..4266fbb6aaed --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..cc4da1504121 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb @@ -0,0 +1,67 @@ +# 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\"\xb2\x01\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\"5\n\x15\x41\x64\x61ptiveMtTranslation\x12\x1c\n\x0ftranslated_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\x88\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\"\xf3\x02\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:\x8a\x01\xea\x41\x86\x01\n\'translate.googleapis.com/AdaptiveMtFile\x12[projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}\"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\"\xaf\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:\xad\x01\xea\x41\xa9\x01\n+translate.googleapis.com/AdaptiveMtSentence\x12zprojects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}\"\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\xc9\x01\n\x1d\x63om.google.cloud.translate.v3B\x0f\x41\x64\x61ptiveMtProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\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 => e + # 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 + 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/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..bb8df94f8bc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb @@ -0,0 +1,46 @@ +# 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' + + +descriptor_data = "\n&google/cloud/translate/v3/common.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.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\x42\xc5\x01\n\x1d\x63om.google.cloud.translate.v3B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\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 => e + # 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 + 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..e14236f02a4e --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..516a79c6783c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ff4a3957f1fd --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb @@ -0,0 +1,2680 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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" + +module Google + module Cloud + module Translate + module V3 + module TranslationService + ## + # Client for the TranslationService service. + # + # Provides natural language translation operations. + # + class Client + # @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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Translate::V3::TranslationService::Operations] + # + attr_reader :operations_client + + # 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, 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. 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. + # @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`, + # + # + # 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 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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. 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. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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. + # @param target_language_codes [::Array<::String>] + # Required. Specify up to 10 language codes here. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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) + # 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. + # For now only one sentence per request is supported. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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. + # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] + # Google Cloud Storage file source. + # + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 `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 `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 `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 + + # @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 + 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 + 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 + 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 + + 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..bbc59e31d50c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..665f9fece6d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Translate + module V3 + module TranslationService + # Service that implements Longrunning Operations API. + class Operations + # @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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a8437ea836b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 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 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 + + 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..3f7e5c8bd9e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/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/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..9f18221b0ec3 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb @@ -0,0 +1,2514 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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" + +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 + 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 + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Translate::V3::TranslationService::Rest::Operations] + # + attr_reader :operations_client + + # 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, 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. 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. + # @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`, + # + # + # 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 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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. 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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. + # @param target_language_codes [::Array<::String>] + # Required. Specify up to 10 language codes here. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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) + # 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. + # For now only one sentence per request is supported. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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. + # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] + # Google Cloud Storage file source. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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 `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 `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 `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 + + # @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 + 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 + 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 + 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 + + 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..f91a2c9274b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb @@ -0,0 +1,1060 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the 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..92bd37858395 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb @@ -0,0 +1,1279 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::TranslateTextResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::DetectLanguageResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::SupportedLanguages.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListGlossariesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::Glossary.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtFile.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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 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 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 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 + 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..3a43ba999c0f --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb @@ -0,0 +1,94 @@ +# 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/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/translate/v3/adaptive_mt_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/translate/v3/translation_service.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/translate/v3/adaptive_mt.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"N\n\x1bTranslateTextGlossaryConfig\x12\x15\n\x08glossary\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xb5\x03\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\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\"\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\"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\"\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\"\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\x32\xa8&\n\x12TranslationService\x12\xd4\x02\n\rTranslateText\x12\x31.google.cloud.translation.v3.TranslateTextRequest\x1a\x32.google.cloud.translation.v3.TranslateTextResponse\"\xdb\x01\x82\xd3\xe4\x93\x02\x62\"1/v3/{parent=projects/*/locations/*}:translateText:\x01*Z*\"%/v3/{parent=projects/*}:translateText:\x01*\xda\x41$parent,target_language_code,contents\xda\x41Iparent,model,mime_type,source_language_code,target_language_code,contents\x12\x87\x02\n\x0e\x44\x65tectLanguage\x12\x32.google.cloud.translation.v3.DetectLanguageRequest\x1a\x33.google.cloud.translation.v3.DetectLanguageResponse\"\x8b\x01\x82\xd3\xe4\x93\x02\x64\"2/v3/{parent=projects/*/locations/*}:detectLanguage:\x01*Z+\"&/v3/{parent=projects/*}:detectLanguage:\x01*\xda\x41\x1eparent,model,mime_type,content\x12\x97\x02\n\x15GetSupportedLanguages\x12\x39.google.cloud.translation.v3.GetSupportedLanguagesRequest\x1a/.google.cloud.translation.v3.SupportedLanguages\"\x91\x01\x82\xd3\xe4\x93\x02\x66\x12\x36/v3/{parent=projects/*/locations/*}/supportedLanguagesZ,\x12*/v3/{parent=projects/*}/supportedLanguages\xda\x41\"parent,model,display_language_code\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\x82\xd3\xe4\x93\x02;\"6/v3/{parent=projects/*/locations/*}:batchTranslateText:\x01*\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x12\xce\x02\n\x16\x42\x61tchTranslateDocument\x12:.google.cloud.translation.v3.BatchTranslateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x01\x82\xd3\xe4\x93\x02?\":/v3/{parent=projects/*/locations/*}:batchTranslateDocument:\x01*\xda\x41Mparent,source_language_code,target_language_codes,input_configs,output_config\xca\x41@\n\x1e\x42\x61tchTranslateDocumentResponse\x12\x1e\x42\x61tchTranslateDocumentMetadata\x12\xdc\x01\n\x0e\x43reateGlossary\x12\x32.google.cloud.translation.v3.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation\"w\x82\xd3\xe4\x93\x02:\"./v3/{parent=projects/*/locations/*}/glossaries:\x08glossary\xda\x41\x0fparent,glossary\xca\x41\"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\x12\xba\x01\n\x0eListGlossaries\x12\x32.google.cloud.translation.v3.ListGlossariesRequest\x1a\x33.google.cloud.translation.v3.ListGlossariesResponse\"?\x82\xd3\xe4\x93\x02\x30\x12./v3/{parent=projects/*/locations/*}/glossaries\xda\x41\x06parent\x12\xa4\x01\n\x0bGetGlossary\x12/.google.cloud.translation.v3.GetGlossaryRequest\x1a%.google.cloud.translation.v3.Glossary\"=\x82\xd3\xe4\x93\x02\x30\x12./v3/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\x12\xd5\x01\n\x0e\x44\x65leteGlossary\x12\x32.google.cloud.translation.v3.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation\"p\x82\xd3\xe4\x93\x02\x30*./v3/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\x12\xf8\x01\n\x17\x43reateAdaptiveMtDataset\x12;.google.cloud.translation.v3.CreateAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"p\x82\xd3\xe4\x93\x02M\"6/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets:\x13\x61\x64\x61ptive_mt_dataset\xda\x41\x1aparent,adaptive_mt_dataset\x12\xb5\x01\n\x17\x44\x65leteAdaptiveMtDataset\x12;.google.cloud.translation.v3.DeleteAdaptiveMtDatasetRequest\x1a\x16.google.protobuf.Empty\"E\x82\xd3\xe4\x93\x02\x38*6/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\xda\x41\x04name\x12\xc7\x01\n\x14GetAdaptiveMtDataset\x12\x38.google.cloud.translation.v3.GetAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"E\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\xda\x41\x04name\x12\xda\x01\n\x16ListAdaptiveMtDatasets\x12:.google.cloud.translation.v3.ListAdaptiveMtDatasetsRequest\x1a;.google.cloud.translation.v3.ListAdaptiveMtDatasetsResponse\"G\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets\xda\x41\x06parent\x12\xdd\x01\n\x13\x41\x64\x61ptiveMtTranslate\x12\x37.google.cloud.translation.v3.AdaptiveMtTranslateRequest\x1a\x38.google.cloud.translation.v3.AdaptiveMtTranslateResponse\"S\x82\xd3\xe4\x93\x02<\"7/v3/{parent=projects/*/locations/*}:adaptiveMtTranslate:\x01*\xda\x41\x0eparent,content\x12\xd0\x01\n\x11GetAdaptiveMtFile\x12\x35.google.cloud.translation.v3.GetAdaptiveMtFileRequest\x1a+.google.cloud.translation.v3.AdaptiveMtFile\"W\x82\xd3\xe4\x93\x02J\x12H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\xda\x41\x04name\x12\xc1\x01\n\x14\x44\x65leteAdaptiveMtFile\x12\x38.google.cloud.translation.v3.DeleteAdaptiveMtFileRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02J*H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\xda\x41\x04name\x12\xee\x01\n\x14ImportAdaptiveMtFile\x12\x38.google.cloud.translation.v3.ImportAdaptiveMtFileRequest\x1a\x39.google.cloud.translation.v3.ImportAdaptiveMtFileResponse\"a\x82\xd3\xe4\x93\x02R\"M/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}:importAdaptiveMtFile:\x01*\xda\x41\x06parent\x12\xe3\x01\n\x13ListAdaptiveMtFiles\x12\x37.google.cloud.translation.v3.ListAdaptiveMtFilesRequest\x1a\x38.google.cloud.translation.v3.ListAdaptiveMtFilesResponse\"Y\x82\xd3\xe4\x93\x02J\x12H/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtFiles\xda\x41\x06parent\x12\xd7\x02\n\x17ListAdaptiveMtSentences\x12;.google.cloud.translation.v3.ListAdaptiveMtSentencesRequest\x1a<.google.cloud.translation.v3.ListAdaptiveMtSentencesResponse\"\xc0\x01\x82\xd3\xe4\x93\x02\xb0\x01\x12^/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}/adaptiveMtSentencesZN\x12L/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtSentences\xda\x41\x06parent\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\xd1\x01\n\x1d\x63om.google.cloud.translate.v3B\x17TranslationServiceProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\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 => e + # 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 Translate + module V3 + TranslateTextGlossaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextGlossaryConfig").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 + 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 + 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 + 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 + 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 + 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..0f94199eb19c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb @@ -0,0 +1,104 @@ +# 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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + # 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 + # 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 + # 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 + 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..94e58eeca03f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..1f9dfae2bf4c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # For now only one sentence per request is supported. + class AdaptiveMtTranslateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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. + 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. + # @!attribute [rw] gcs_input_source + # @return [::Google::Cloud::Translate::V3::GcsInputSource] + # Google Cloud Storage file source. + 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/common.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb new file mode 100644 index 000000000000..bcd5f44c03b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + 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..9e2b70975b71 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb @@ -0,0 +1,1439 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 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. + class TranslateTextGlossaryConfig + 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. 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. + # @!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`, + # + # + # 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] 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 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. + # @!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 + # @!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. 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. + # @!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. + # @!attribute [rw] target_language_codes + # @return [::Array<::String>] + # Required. Specify up to 10 language codes here. + # @!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. + # @!attribute [rw] language_codes_set + # @return [::Google::Cloud::Translate::V3::Glossary::LanguageCodesSet] + # Used with equivalent term set glossaries. + # @!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 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 + + # 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 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. + # @!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 + 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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/timestamp.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..7d5e15f02316 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..62d2551870a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json @@ -0,0 +1,815 @@ +{ + "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_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_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_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" + } + ] + } + ] +} \ 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..958fb7691729 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d7fbe88fa4f1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b55c207d0f3a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..980f68f1c8bc --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb new file mode 100644 index 000000000000..cc243a1da67a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..251110741fb7 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..894999dde9cc --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb new file mode 100644 index 000000000000..7dcb6d46f8a9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/detect_language.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb new file mode 100644 index 000000000000..82875356ae12 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..f8fab6488146 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9c57bc6ed531 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb new file mode 100644 index 000000000000..634988a6f7b6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_supported_languages.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb new file mode 100644 index 000000000000..13dec890a2ca --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..6dbd5d26bcd1 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..35a9a39e6f2a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1e4952f64dec --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..85a465c30e7b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_glossaries.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb new file mode 100644 index 000000000000..dfb31b43cb15 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/translate_document.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb new file mode 100644 index 000000000000..f1284338b62d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..ccbc5c1fa3b4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..2a03b67e9372 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..71e69df43596 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/translate/v3/translation_service" + +class ::Google::Cloud::Translate::V3::TranslationService::ClientPathsTest < Minitest::Test + def test_adaptive_mt_dataset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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_glossary_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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 +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..63f5a5cc82f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb @@ -0,0 +1,1218 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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 = {} + labels = {} + + translate_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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, 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, 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, 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, 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, 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_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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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"] + + adaptive_mt_translate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::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 }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.adaptive_mt_translate parent: parent, dataset: dataset, content: content 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) 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 }, 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), 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_configure + credentials_token = :dummy_value + + client = block_config = config = nil + Gapic::Rest::ClientStub.stub :new, nil 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..e974c127767f --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb @@ -0,0 +1,1394 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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 = {} + 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({}, 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, 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, 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, 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, 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, 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_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_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_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"] + + 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"] + 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 }) 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 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) 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 }, 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), 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_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..fe92dfe95698 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-translate-v2", path: "../google-cloud-translate-v2" +gem "google-cloud-translate-v3", path: "../google-cloud-translate-v3" 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..682f96fafb2c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/README.md @@ -0,0 +1,113 @@ +# 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 +verisoned 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. {file:AUTHENTICATION.md Set up authentication.} + +## 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. + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..aa58d3c591d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-translate" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-translate" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..d3d72ae47255 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec @@ -0,0 +1,37 @@ +# -*- 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 = ">= 2.6" + + 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.6", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +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..bd81a7a722a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..94d4c862ae88 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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, "translate.googleapis.com", 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 +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. + # + # ## 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 + + ## + # 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..cc66c8371011 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..66c8aea3e58a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def test_translation_service_grpc + Gapic::ServiceStub.stub :new, :stub 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 + Gapic::Rest::ClientStub.stub :new, :stub 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..d8731f6b6bd0 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" 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..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-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..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec 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..89fe30c6002e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/README.md @@ -0,0 +1,144 @@ +# 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. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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..e1e030426e25 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-video-live_stream-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-video-live_stream-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +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 tests with coverage." + task :coverage do + 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..9fc9b3277016 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json @@ -0,0 +1,128 @@ +{ + "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" + ] + }, + "CreateInput": { + "methods": [ + "create_input" + ] + }, + "ListInputs": { + "methods": [ + "list_inputs" + ] + }, + "GetInput": { + "methods": [ + "get_input" + ] + }, + "DeleteInput": { + "methods": [ + "delete_input" + ] + }, + "UpdateInput": { + "methods": [ + "update_input" + ] + }, + "CreateEvent": { + "methods": [ + "create_event" + ] + }, + "ListEvents": { + "methods": [ + "list_events" + ] + }, + "GetEvent": { + "methods": [ + "get_event" + ] + }, + "DeleteEvent": { + "methods": [ + "delete_event" + ] + }, + "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..50386ecb7aeb --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec @@ -0,0 +1,38 @@ +# -*- 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 = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +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..f8ec1f9649e9 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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..d7f513f46b79 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..c5736875551c --- /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,104 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module 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 = Configuration.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 + + ## + # @private + # Configuration class for the google.cloud.video.livestream.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.video.livestream.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end + end +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..3fe4043f2a83 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4283102afb99 --- /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,2870 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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.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.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 + 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 + + @location_client = Google::Cloud::Location::Locations::Client.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 + ) + 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 + + # 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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: + # + # * [`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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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 and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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? + return response + 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 and x-goog-user-project headers + metadata[:"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-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? + return 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: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 `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 `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 `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 + 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 + 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 + 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..8b3fc1a2872b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..46dcf7fd4633 --- /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,803 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +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..72d686c49a44 --- /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,185 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 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..bbfca138d68c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4fc822290964 --- /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,2694 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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.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.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 + 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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + config.bindings_override = @config.bindings_override + 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 + ) + 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 + + # 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse] + # + # @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 and x-goog-user-project headers + call_metadata[:"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-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| + yield result, operation if block_given? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse] + # + # @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 and x-goog-user-project headers + call_metadata[:"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-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| + yield result, operation if block_given? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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: + # + # * [`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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse] + # + # @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 and x-goog-user-project headers + call_metadata[:"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-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| + yield result, operation if block_given? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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-z0-9]`, + # could contain dashes (-) in between. + # @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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 [::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse] + # + # @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 and x-goog-user-project headers + call_metadata[:"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-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| + yield result, operation if block_given? + return 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 and x-goog-user-project headers + call_metadata[:"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-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? + return result + 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 and x-goog-user-project headers + call_metadata[:"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-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? + return 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 + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the 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 `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 `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 `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 + 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 + 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 + 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..4944aed5c019 --- /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,897 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + 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`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/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..4d85b25229c8 --- /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,1369 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Channel.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the start_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the stop_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Input.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Asset.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Pool.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + 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, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_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 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 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 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..2d792edac10a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..f1f1742af325 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..e40dd8a19705 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb @@ -0,0 +1,66 @@ +# 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/protobuf/duration_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\x1egoogle/protobuf/duration.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\"\xbc\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\"@\n\x0cManifestType\x12\x1d\n\x19MANIFEST_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03HLS\x10\x01\x12\x08\n\x04\x44\x41SH\x10\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\"\xff\x03\n\x0bVideoStream\x12O\n\x04h264\x18\x14 \x01(\x0b\x32?.google.cloud.video.livestream.v1.VideoStream.H264CodecSettingsH\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_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\" \n\nTextStream\x12\x12\n\x05\x63odec\x18\x01 \x01(\tB\x03\xe0\x41\x02\"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 => e + # 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.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 + 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 + 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 + 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..8e179cadac36 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb @@ -0,0 +1,96 @@ +# 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\"\xf0\x06\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\"5\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:\\\xea\x41Y\n\x1flivestream.googleapis.com/Input\x12\x36projects/{project}/locations/{location}/inputs/{input}\"\x86\x0b\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\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\x41\n\x0b\x65ncryptions\x18\x18 \x03(\x0b\x32,.google.cloud.video.livestream.v1.Encryption\x12\x43\n\x0cinput_config\x18\x19 \x01(\x0b\x32-.google.cloud.video.livestream.v1.InputConfig\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}\"\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\"\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\"\x82\x0b\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\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-\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\"\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\"\x9d\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\xb2\x02\n\nDrmSystems\x12G\n\x08widevine\x18\x01 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.Widevine\x12G\n\x08\x66\x61irplay\x18\x02 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.Fairplay\x12I\n\tplayready\x18\x03 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.Encryption.Playready\x12G\n\x08\x63learkey\x18\x04 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.Clearkey\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\"\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 => e + # 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 + 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 + 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 + 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::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.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 + 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..f568dbff5376 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb @@ -0,0 +1,84 @@ +# 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/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\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\"\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\"\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(\t2\xc2\"\n\x11LivestreamService\x12\xe0\x01\n\rCreateChannel\x12\x36.google.cloud.video.livestream.v1.CreateChannelRequest\x1a\x1d.google.longrunning.Operation\"x\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/channels:\x07\x63hannel\xda\x41\x19parent,channel,channel_id\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\x12\xbc\x01\n\x0cListChannels\x12\x35.google.cloud.video.livestream.v1.ListChannelsRequest\x1a\x36.google.cloud.video.livestream.v1.ListChannelsResponse\"=\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/channels\xda\x41\x06parent\x12\xa9\x01\n\nGetChannel\x12\x33.google.cloud.video.livestream.v1.GetChannelRequest\x1a).google.cloud.video.livestream.v1.Channel\";\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/channels/*}\xda\x41\x04name\x12\xd0\x01\n\rDeleteChannel\x12\x36.google.cloud.video.livestream.v1.DeleteChannelRequest\x1a\x1d.google.longrunning.Operation\"h\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/channels/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xe2\x01\n\rUpdateChannel\x12\x36.google.cloud.video.livestream.v1.UpdateChannelRequest\x1a\x1d.google.longrunning.Operation\"z\x82\xd3\xe4\x93\x02?24/v1/{channel.name=projects/*/locations/*/channels/*}:\x07\x63hannel\xda\x41\x13\x63hannel,update_mask\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\x12\xda\x01\n\x0cStartChannel\x12\x35.google.cloud.video.livestream.v1.StartChannelRequest\x1a\x1d.google.longrunning.Operation\"t\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/channels/*}:start:\x01*\xda\x41\x04name\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\x12\xd7\x01\n\x0bStopChannel\x12\x34.google.cloud.video.livestream.v1.StopChannelRequest\x1a\x1d.google.longrunning.Operation\"s\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/channels/*}:stop:\x01*\xda\x41\x04name\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\x12\xd2\x01\n\x0b\x43reateInput\x12\x34.google.cloud.video.livestream.v1.CreateInputRequest\x1a\x1d.google.longrunning.Operation\"n\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/inputs:\x05input\xda\x41\x15parent,input,input_id\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\x12\xb4\x01\n\nListInputs\x12\x33.google.cloud.video.livestream.v1.ListInputsRequest\x1a\x34.google.cloud.video.livestream.v1.ListInputsResponse\";\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/inputs\xda\x41\x06parent\x12\xa1\x01\n\x08GetInput\x12\x31.google.cloud.video.livestream.v1.GetInputRequest\x1a\'.google.cloud.video.livestream.v1.Input\"9\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/inputs/*}\xda\x41\x04name\x12\xca\x01\n\x0b\x44\x65leteInput\x12\x34.google.cloud.video.livestream.v1.DeleteInputRequest\x1a\x1d.google.longrunning.Operation\"f\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/inputs/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xd4\x01\n\x0bUpdateInput\x12\x34.google.cloud.video.livestream.v1.UpdateInputRequest\x1a\x1d.google.longrunning.Operation\"p\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{input.name=projects/*/locations/*/inputs/*}:\x05input\xda\x41\x11input,update_mask\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\x12\xca\x01\n\x0b\x43reateEvent\x12\x34.google.cloud.video.livestream.v1.CreateEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"\\\x82\xd3\xe4\x93\x02>\"5/v1/{parent=projects/*/locations/*/channels/*}/events:\x05\x65vent\xda\x41\x15parent,event,event_id\x12\xbf\x01\n\nListEvents\x12\x33.google.cloud.video.livestream.v1.ListEventsRequest\x1a\x34.google.cloud.video.livestream.v1.ListEventsResponse\"F\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/channels/*}/events\xda\x41\x06parent\x12\xac\x01\n\x08GetEvent\x12\x31.google.cloud.video.livestream.v1.GetEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/channels/*/events/*}\xda\x41\x04name\x12\xa1\x01\n\x0b\x44\x65leteEvent\x12\x34.google.cloud.video.livestream.v1.DeleteEventRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/channels/*/events/*}\xda\x41\x04name\x12\xd2\x01\n\x0b\x43reateAsset\x12\x34.google.cloud.video.livestream.v1.CreateAssetRequest\x1a\x1d.google.longrunning.Operation\"n\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/assets:\x05\x61sset\xda\x41\x15parent,asset,asset_id\xca\x41\x1a\n\x05\x41sset\x12\x11OperationMetadata\x12\xca\x01\n\x0b\x44\x65leteAsset\x12\x34.google.cloud.video.livestream.v1.DeleteAssetRequest\x1a\x1d.google.longrunning.Operation\"f\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/assets/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xa1\x01\n\x08GetAsset\x12\x31.google.cloud.video.livestream.v1.GetAssetRequest\x1a\'.google.cloud.video.livestream.v1.Asset\"9\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/assets/*}\xda\x41\x04name\x12\xb4\x01\n\nListAssets\x12\x33.google.cloud.video.livestream.v1.ListAssetsRequest\x1a\x34.google.cloud.video.livestream.v1.ListAssetsResponse\";\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/assets\xda\x41\x06parent\x12\x9d\x01\n\x07GetPool\x12\x30.google.cloud.video.livestream.v1.GetPoolRequest\x1a&.google.cloud.video.livestream.v1.Pool\"8\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/pools/*}\xda\x41\x04name\x12\xcd\x01\n\nUpdatePool\x12\x33.google.cloud.video.livestream.v1.UpdatePoolRequest\x1a\x1d.google.longrunning.Operation\"k\x82\xd3\xe4\x93\x02\x36\x32./v1/{pool.name=projects/*/locations/*/pools/*}:\x04pool\xda\x41\x10pool,update_mask\xca\x41\x19\n\x04Pool\x12\x11OperationMetadata\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 => e + # 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 + 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 + 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 + 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..c5fe1b3ac374 --- /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,97 @@ +# 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 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + # 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 + # 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 + # 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..97b34b4de8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb @@ -0,0 +1,395 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + 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 + 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. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!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: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-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..b03587481349 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/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..38b4b61e6061 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..6497ebc78dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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'. 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..77ced902335d --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb @@ -0,0 +1,509 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # @!attribute [rw] video_stream + # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream] + # Encoding of a video stream. + # @!attribute [rw] audio_stream + # @return [::Google::Cloud::Video::LiveStream::V1::AudioStream] + # Encoding of an audio stream. + # @!attribute [rw] text_stream + # @return [::Google::Cloud::Video::LiveStream::V1::TextStream] + # Encoding of a text stream. For example, closed captions or subtitles. + 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. + # @!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`. + # @!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. + 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 + + # 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. + 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, 1920]. + # @!attribute [rw] height_pixels + # @return [::Integer] + # Required. The height of the video in pixels. Must be an even integer. + # Valid range is [180, 1080]. + # @!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). + # @!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]. + # @!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. + # @!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 + 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` + class TextStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone e.g. "America/Los_Angeles". + 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..33cdc41a8418 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb @@ -0,0 +1,813 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. Not supported yet. + UHD = 3 + 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] 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>] + # 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}. + 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 + + # 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 + + # 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. + # @!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 + + # 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. + # @!attribute [rw] ad_break + # @return [::Google::Cloud::Video::LiveStream::V1::Event::AdBreakTask] + # Inserts a new ad opportunity. + # @!attribute [rw] return_to_program + # @return [::Google::Cloud::Video::LiveStream::V1::Event::ReturnToProgramTask] + # Stops any running ad break. + # @!attribute [rw] slate + # @return [::Google::Cloud::Video::LiveStream::V1::Event::SlateTask] + # Inserts a slate. + # @!attribute [rw] mute + # @return [::Google::Cloud::Video::LiveStream::V1::Event::MuteTask] + # Mutes the stream. + # @!attribute [rw] unmute + # @return [::Google::Cloud::Video::LiveStream::V1::Event::UnmuteTask] + # Unmutes the stream. + # @!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 it will be looped. 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 will fail if the stream is not + # currently muted. + class UnmuteTask + 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 + + # 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. + # @!attribute [rw] image + # @return [::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset] + # ImageAsset represents an image. + # @!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 + # [VideoAsset.uri] or [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 + # [VideoAsset.uri] or [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 format is JPEG. + # @!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. + # @!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. + # @!attribute [rw] sample_aes + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SampleAesEncryption] + # Configuration for HLS SAMPLE-AES encryption. + # @!attribute [rw] mpeg_cenc + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::MpegCommonEncryption] + # Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + 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] + # Widevine configuration. + # @!attribute [rw] fairplay + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Fairplay] + # Fairplay configuration. + # @!attribute [rw] playready + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Playready] + # Playready configuration. + # @!attribute [rw] clearkey + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Clearkey] + # 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 + + # 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..59ba6416f4b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb @@ -0,0 +1,684 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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-z0-9]`, + # could contain dashes (-) in between. + # @!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-z0-9]`, + # could contain dashes (-) in between. + # @!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.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-z0-9]`, + # could contain dashes (-) in between. + # @!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: + # + # * [`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-z0-9]`, + # could contain dashes (-) in between. + # @!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 + + # 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 [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 + 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..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-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..a93d05e10a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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. + # + # 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..b5731a824060 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8c6b19d52e3d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..8e7abcf8f052 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..4ac9c4801a3f --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..09acc69b6125 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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..7be9d37b7d84 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 }. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone. + 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..3d6fc9fa3564 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-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..b1a4edab860b --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5c71dee02fcf --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb new file mode 100644 index 000000000000..2f6fd0ca85e6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5179796af42d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a25ca81afc9c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..b0d7ec0fcef4 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb new file mode 100644 index 000000000000..6ef121907782 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..9438d3865ffe --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..a8581a2c1c9d --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..d5a90d6f1ad6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb new file mode 100644 index 000000000000..a859a16415b2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..1bcfddcf4c4c --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..cc3e68e14a9a --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5ce9ab53ee26 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..be61d42bd8cf --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_events.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb new file mode 100644 index 000000000000..6b3f73f1b4b3 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..040965f21c67 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..f8ed7573d436 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..767f7c0b7e69 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/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..7a5b54ae1ce2 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb new file mode 100644 index 000000000000..e61c5a50f7ff --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..5cc3dab663f6 --- /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 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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..4971bc8bb0ca --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json @@ -0,0 +1,895 @@ +{ + "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_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_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_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..506bed9f1d65 --- /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,380 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::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 }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::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 + Gapic::ServiceStub.stub :new, nil 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..111ecbec1406 --- /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,121 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +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 + def test_asset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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_event_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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, nil 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, nil 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..b6e801c6cc3a --- /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,1311 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + 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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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_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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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:| + assert options.metadata.key? :"x-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 + Gapic::Rest::ClientStub.stub :new, nil 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..bf3c8c239da2 --- /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,1513 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + 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_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_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_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 + Gapic::ServiceStub.stub :new, nil 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_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil 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..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" diff --git a/owl-bot-staging/google-cloud-video-live_stream/.gitignore b/owl-bot-staging/google-cloud-video-live_stream/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-video-live_stream/.repo-metadata.json new file mode 100644 index 000000000000..477c8211cefe --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/.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/latest", + "distribution_name": "google-cloud-video-live_stream", + "is_cloud": true, + "language": "ruby", + "name": "livestream", + "name_pretty": "Live Stream 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.", + "ruby-cloud-product-url": "https://cloud.google.com/livestream/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml b/owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml new file mode 100644 index 000000000000..0b685af2be48 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-video-live_stream.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-video-live_stream.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-video-live_stream/.toys.rb b/owl-bot-staging/google-cloud-video-live_stream/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-video-live_stream/.yardopts b/owl-bot-staging/google-cloud-video-live_stream/.yardopts new file mode 100644 index 000000000000..be95511d9eae --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Live Stream 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-video-live_stream/AUTHENTICATION.md b/owl-bot-staging/google-cloud-video-live_stream/AUTHENTICATION.md new file mode 100644 index 000000000000..9d50f4481173 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-video-live_stream 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 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" + +client = Google::Cloud::Video::LiveStream.livestream_service 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" + +Google::Cloud::Video::LiveStream.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Video::LiveStream.livestream_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-video-live_stream +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" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Video::LiveStream.livestream_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-video-live_stream/CHANGELOG.md b/owl-bot-staging/google-cloud-video-live_stream/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-video-live_stream/Gemfile b/owl-bot-staging/google-cloud-video-live_stream/Gemfile new file mode 100644 index 000000000000..a7f25bb01d1d --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-video-live_stream-v1", path: "../google-cloud-video-live_stream-v1" diff --git a/owl-bot-staging/google-cloud-video-live_stream/LICENSE.md b/owl-bot-staging/google-cloud-video-live_stream/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/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/README.md b/owl-bot-staging/google-cloud-video-live_stream/README.md new file mode 100644 index 000000000000..5628817e02d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/README.md @@ -0,0 +1,104 @@ +# Ruby Client for the Live Stream API + +API Client library for the Live Stream 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. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-video-live_stream-v*`. +The gem `google-cloud-video-live_stream` is the main client library that brings the +verisoned 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-video-live_stream/latest) +for this library, google-cloud-video-live_stream, 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-video-live_stream-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/livestream/) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-video-live_stream +``` + +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. {file:AUTHENTICATION.md Set up authentication.} + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +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/Rakefile b/owl-bot-staging/google-cloud-video-live_stream/Rakefile new file mode 100644 index 000000000000..ac1dc7bd53e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-video-live_stream" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +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 + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-video-live_stream" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +end + +# Acceptance tests +desc "Run the google-cloud-video-live_stream 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 gem has no acceptance tests." + end + end + + desc "Run acceptance tests with coverage." + task :coverage do + 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 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 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 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-video-live_stream" + header "google-cloud-video-live_stream rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-video-live_stream yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-video-live_stream 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 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 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/google-cloud-video-live_stream.gemspec b/owl-bot-staging/google-cloud-video-live_stream/google-cloud-video-live_stream.gemspec new file mode 100644 index 000000000000..6d32490e8eb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/google-cloud-video-live_stream.gemspec @@ -0,0 +1,36 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/video/live_stream/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-video-live_stream" + gem.version = Google::Cloud::Video::LiveStream::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." + gem.summary = "API Client library for the Live Stream 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 = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-video-live_stream-v1", ">= 0.3", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +end diff --git a/owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb b/owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb new file mode 100644 index 000000000000..19a71a403c18 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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" unless defined? Google::Cloud::Video::LiveStream::VERSION diff --git a/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb b/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb new file mode 100644 index 000000000000..3121dde4507d --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/video/live_stream/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! :video_live_stream do |config| + config.add_field! :endpoint, "livestream.googleapis.com", 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 +end + +module Google + module Cloud + module Video + module LiveStream + ## + # Create a new client object for LivestreamService. + # + # By default, this returns an instance of + # [Google::Cloud::Video::LiveStream::V1::LivestreamService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest/Google-Cloud-Video-LiveStream-V1-LivestreamService-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 LivestreamService 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. + # + # ## About 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). + # + # @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.livestream_service version: :v1, transport: :grpc, &block + require "google/cloud/video/live_stream/#{version.to_s.downcase}" + + package_name = Google::Cloud::Video::LiveStream + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Video::LiveStream.const_get(package_name).const_get(:LivestreamService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Configure the google-cloud-video-live_stream 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.video_live_stream if block_given? + + ::Google::Cloud.configure.video_live_stream + end + end + end + end +end + +helper_path = ::File.join __dir__, "live_stream", "helpers.rb" +require "google/cloud/video/live_stream/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb b/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb new file mode 100644 index 000000000000..190207801664 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Video + module LiveStream + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb b/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb new file mode 100644 index 000000000000..f9018b1f8829 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/video/live_stream" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Video::LiveStream::ClientConstructionMinitest < Minitest::Test + def test_livestream_service_grpc + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Video::LiveStream.livestream_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client, client + end + end + + def test_livestream_service_rest + Gapic::Rest::ClientStub.stub :new, :stub do + client = Google::Cloud::Video::LiveStream.livestream_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb b/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb new file mode 100644 index 000000000000..f3e3a42b9abb --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/video/live_stream/version" + +class Google::Cloud::Video::LiveStream::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Video::LiveStream::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream/test/helper.rb b/owl-bot-staging/google-cloud-video-live_stream/test/helper.rb new file mode 100644 index 000000000000..733ebfbb09ac --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" From 3a6dfe08d0c402357e4f2d6a8c9a07abafa22e69 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 10 Jan 2024 18:43:44 +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-talent-v4/.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-talent-v4/AUTHENTICATION.md | 173 +- .../google-cloud-talent-v4.gemspec | 2 +- .../cloud/talent/v4/company_service/client.rb | 39 +- .../talent/v4/company_service/rest/client.rb | 40 +- .../v4/company_service/rest/service_stub.rb | 16 +- .../cloud/talent/v4/completion/client.rb | 39 +- .../cloud/talent/v4/completion/rest/client.rb | 40 +- .../talent/v4/completion/rest/service_stub.rb | 16 +- .../cloud/talent/v4/event_service/client.rb | 39 +- .../talent/v4/event_service/rest/client.rb | 40 +- .../v4/event_service/rest/service_stub.rb | 16 +- .../cloud/talent/v4/job_service/client.rb | 40 +- .../cloud/talent/v4/job_service/operations.rb | 34 +- .../talent/v4/job_service/rest/client.rb | 41 +- .../talent/v4/job_service/rest/operations.rb | 41 +- .../v4/job_service/rest/service_stub.rb | 16 +- .../cloud/talent/v4/tenant_service/client.rb | 39 +- .../talent/v4/tenant_service/rest/client.rb | 40 +- .../v4/tenant_service/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../google/cloud/talent/v4/common.rb | 1 + .../google/cloud/talent/v4/company.rb | 1 + .../proto_docs/google/cloud/talent/v4/job.rb | 1 + .../google/cloud/talent/v4/job_service.rb | 1 + .../company_service/create_company.rb | 9 +- .../company_service/delete_company.rb | 9 +- .../snippets/company_service/get_company.rb | 9 +- .../company_service/list_companies.rb | 9 +- .../company_service/update_company.rb | 9 +- .../snippets/completion/complete_query.rb | 9 +- .../event_service/create_client_event.rb | 9 +- .../snippets/job_service/batch_create_jobs.rb | 9 +- .../snippets/job_service/batch_delete_jobs.rb | 9 +- .../snippets/job_service/batch_update_jobs.rb | 9 +- .../snippets/job_service/create_job.rb | 9 +- .../snippets/job_service/delete_job.rb | 9 +- .../snippets/job_service/get_job.rb | 9 +- .../snippets/job_service/list_jobs.rb | 9 +- .../snippets/job_service/search_jobs.rb | 9 +- .../job_service/search_jobs_for_alert.rb | 9 +- .../snippets/job_service/update_job.rb | 9 +- ...ippet_metadata_google.cloud.talent.v4.json | 88 +- .../snippets/tenant_service/create_tenant.rb | 9 +- .../snippets/tenant_service/delete_tenant.rb | 9 +- .../snippets/tenant_service/get_tenant.rb | 9 +- .../snippets/tenant_service/list_tenants.rb | 9 +- .../snippets/tenant_service/update_tenant.rb | 9 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-talent-v4beta1/AUTHENTICATION.md | 173 +- .../google-cloud-talent-v4beta1.gemspec | 2 +- .../talent/v4beta1/company_service/client.rb | 39 +- .../v4beta1/company_service/rest/client.rb | 40 +- .../company_service/rest/service_stub.rb | 16 +- .../cloud/talent/v4beta1/completion/client.rb | 39 +- .../talent/v4beta1/completion/rest/client.rb | 40 +- .../v4beta1/completion/rest/service_stub.rb | 16 +- .../talent/v4beta1/event_service/client.rb | 39 +- .../v4beta1/event_service/rest/client.rb | 40 +- .../event_service/rest/service_stub.rb | 16 +- .../talent/v4beta1/job_service/client.rb | 40 +- .../talent/v4beta1/job_service/operations.rb | 34 +- .../talent/v4beta1/job_service/rest/client.rb | 41 +- .../v4beta1/job_service/rest/operations.rb | 41 +- .../v4beta1/job_service/rest/service_stub.rb | 16 +- .../talent/v4beta1/tenant_service/client.rb | 39 +- .../v4beta1/tenant_service/rest/client.rb | 40 +- .../tenant_service/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../google/cloud/talent/v4beta1/common.rb | 1 + .../google/cloud/talent/v4beta1/company.rb | 1 + .../google/cloud/talent/v4beta1/job.rb | 1 + .../cloud/talent/v4beta1/job_service.rb | 1 + .../company_service/create_company.rb | 9 +- .../company_service/delete_company.rb | 9 +- .../snippets/company_service/get_company.rb | 9 +- .../company_service/list_companies.rb | 9 +- .../company_service/update_company.rb | 9 +- .../snippets/completion/complete_query.rb | 9 +- .../event_service/create_client_event.rb | 9 +- .../snippets/job_service/batch_create_jobs.rb | 9 +- .../snippets/job_service/batch_delete_jobs.rb | 9 +- .../snippets/job_service/batch_update_jobs.rb | 9 +- .../snippets/job_service/create_job.rb | 9 +- .../snippets/job_service/delete_job.rb | 9 +- .../snippets/job_service/get_job.rb | 9 +- .../snippets/job_service/list_jobs.rb | 9 +- .../snippets/job_service/search_jobs.rb | 9 +- .../job_service/search_jobs_for_alert.rb | 9 +- .../snippets/job_service/update_job.rb | 9 +- ..._metadata_google.cloud.talent.v4beta1.json | 88 +- .../snippets/tenant_service/create_tenant.rb | 9 +- .../snippets/tenant_service/delete_tenant.rb | 9 +- .../snippets/tenant_service/get_tenant.rb | 9 +- .../snippets/tenant_service/list_tenants.rb | 9 +- .../snippets/tenant_service/update_tenant.rb | 9 +- google-cloud-tasks-v2/.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-tasks-v2/AUTHENTICATION.md | 173 +- .../google-cloud-tasks-v2.gemspec | 4 +- .../cloud/tasks/v2/cloud_tasks/client.rb | 40 +- .../cloud/tasks/v2/cloud_tasks/rest/client.rb | 41 +- .../tasks/v2/cloud_tasks/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../snippets/cloud_tasks/create_queue.rb | 9 +- .../snippets/cloud_tasks/create_task.rb | 9 +- .../snippets/cloud_tasks/delete_queue.rb | 9 +- .../snippets/cloud_tasks/delete_task.rb | 9 +- .../snippets/cloud_tasks/get_iam_policy.rb | 9 +- .../snippets/cloud_tasks/get_queue.rb | 9 +- .../snippets/cloud_tasks/get_task.rb | 9 +- .../snippets/cloud_tasks/list_queues.rb | 9 +- .../snippets/cloud_tasks/list_tasks.rb | 9 +- .../snippets/cloud_tasks/pause_queue.rb | 9 +- .../snippets/cloud_tasks/purge_queue.rb | 9 +- .../snippets/cloud_tasks/resume_queue.rb | 9 +- .../snippets/cloud_tasks/run_task.rb | 9 +- .../snippets/cloud_tasks/set_iam_policy.rb | 9 +- .../cloud_tasks/test_iam_permissions.rb | 9 +- .../snippets/cloud_tasks/update_queue.rb | 9 +- ...nippet_metadata_google.cloud.tasks.v2.json | 64 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-tasks-v2beta2/AUTHENTICATION.md | 173 +- .../google-cloud-tasks-v2beta2.gemspec | 4 +- .../cloud/tasks/v2beta2/cloud_tasks/client.rb | 40 +- .../tasks/v2beta2/cloud_tasks/rest/client.rb | 41 +- .../v2beta2/cloud_tasks/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../snippets/cloud_tasks/acknowledge_task.rb | 9 +- .../snippets/cloud_tasks/buffer_task.rb | 9 +- .../snippets/cloud_tasks/cancel_lease.rb | 9 +- .../snippets/cloud_tasks/create_queue.rb | 9 +- .../snippets/cloud_tasks/create_task.rb | 9 +- .../snippets/cloud_tasks/delete_queue.rb | 9 +- .../snippets/cloud_tasks/delete_task.rb | 9 +- .../snippets/cloud_tasks/get_iam_policy.rb | 9 +- .../snippets/cloud_tasks/get_queue.rb | 9 +- .../snippets/cloud_tasks/get_task.rb | 9 +- .../snippets/cloud_tasks/lease_tasks.rb | 9 +- .../snippets/cloud_tasks/list_queues.rb | 9 +- .../snippets/cloud_tasks/list_tasks.rb | 9 +- .../snippets/cloud_tasks/pause_queue.rb | 9 +- .../snippets/cloud_tasks/purge_queue.rb | 9 +- .../snippets/cloud_tasks/renew_lease.rb | 9 +- .../snippets/cloud_tasks/resume_queue.rb | 9 +- .../snippets/cloud_tasks/run_task.rb | 9 +- .../snippets/cloud_tasks/set_iam_policy.rb | 9 +- .../cloud_tasks/test_iam_permissions.rb | 9 +- .../snippets/cloud_tasks/update_queue.rb | 9 +- .../snippets/cloud_tasks/upload_queue_yaml.rb | 9 +- ...t_metadata_google.cloud.tasks.v2beta2.json | 88 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-tasks-v2beta3/AUTHENTICATION.md | 173 +- .../google-cloud-tasks-v2beta3.gemspec | 4 +- .../cloud/tasks/v2beta3/cloud_tasks/client.rb | 40 +- .../tasks/v2beta3/cloud_tasks/rest/client.rb | 41 +- .../v2beta3/cloud_tasks/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../snippets/cloud_tasks/buffer_task.rb | 9 +- .../snippets/cloud_tasks/create_queue.rb | 9 +- .../snippets/cloud_tasks/create_task.rb | 9 +- .../snippets/cloud_tasks/delete_queue.rb | 9 +- .../snippets/cloud_tasks/delete_task.rb | 9 +- .../snippets/cloud_tasks/get_iam_policy.rb | 9 +- .../snippets/cloud_tasks/get_queue.rb | 9 +- .../snippets/cloud_tasks/get_task.rb | 9 +- .../snippets/cloud_tasks/list_queues.rb | 9 +- .../snippets/cloud_tasks/list_tasks.rb | 9 +- .../snippets/cloud_tasks/pause_queue.rb | 9 +- .../snippets/cloud_tasks/purge_queue.rb | 9 +- .../snippets/cloud_tasks/resume_queue.rb | 9 +- .../snippets/cloud_tasks/run_task.rb | 9 +- .../snippets/cloud_tasks/set_iam_policy.rb | 9 +- .../cloud_tasks/test_iam_permissions.rb | 9 +- .../snippets/cloud_tasks/update_queue.rb | 9 +- ...t_metadata_google.cloud.tasks.v2beta3.json | 68 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 .../AUTHENTICATION.md | 171 +- .../google-cloud-telco_automation-v1.gemspec | 4 +- .../v1/telco_automation/client.rb | 41 +- .../v1/telco_automation/operations.rb | 34 +- .../v1/telco_automation/rest/client.rb | 42 +- .../v1/telco_automation/rest/operations.rb | 41 +- .../v1/telco_automation/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + ...adata_google.cloud.telcoautomation.v1.json | 144 +- .../telco_automation/apply_deployment.rb | 7 +- .../apply_hydrated_deployment.rb | 7 +- .../telco_automation/approve_blueprint.rb | 7 +- .../compute_deployment_status.rb | 7 +- .../telco_automation/create_blueprint.rb | 7 +- .../telco_automation/create_deployment.rb | 7 +- .../telco_automation/create_edge_slm.rb | 7 +- .../create_orchestration_cluster.rb | 7 +- .../telco_automation/delete_blueprint.rb | 7 +- .../telco_automation/delete_edge_slm.rb | 7 +- .../delete_orchestration_cluster.rb | 7 +- .../discard_blueprint_changes.rb | 7 +- .../discard_deployment_changes.rb | 7 +- .../telco_automation/get_blueprint.rb | 9 +- .../telco_automation/get_deployment.rb | 9 +- .../snippets/telco_automation/get_edge_slm.rb | 9 +- .../get_hydrated_deployment.rb | 7 +- .../get_orchestration_cluster.rb | 7 +- .../telco_automation/get_public_blueprint.rb | 7 +- .../list_blueprint_revisions.rb | 7 +- .../telco_automation/list_blueprints.rb | 7 +- .../list_deployment_revisions.rb | 7 +- .../telco_automation/list_deployments.rb | 7 +- .../telco_automation/list_edge_slms.rb | 9 +- .../list_hydrated_deployments.rb | 7 +- .../list_orchestration_clusters.rb | 7 +- .../list_public_blueprints.rb | 7 +- .../telco_automation/propose_blueprint.rb | 7 +- .../telco_automation/reject_blueprint.rb | 7 +- .../telco_automation/remove_deployment.rb | 7 +- .../telco_automation/rollback_deployment.rb | 7 +- .../search_blueprint_revisions.rb | 7 +- .../search_deployment_revisions.rb | 7 +- .../telco_automation/update_blueprint.rb | 7 +- .../telco_automation/update_deployment.rb | 7 +- .../update_hydrated_deployment.rb | 7 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 .../AUTHENTICATION.md | 173 +- .../google-cloud-text_to_speech-v1.gemspec | 2 +- .../v1/text_to_speech/client.rb | 39 +- .../v1/text_to_speech/rest/client.rb | 40 +- .../v1/text_to_speech/rest/service_stub.rb | 16 +- .../client.rb | 40 +- .../operations.rb | 34 +- .../rest/client.rb | 41 +- .../rest/operations.rb | 41 +- .../rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../google/cloud/texttospeech/v1/cloud_tts.rb | 1 + .../cloud/texttospeech/v1/cloud_tts_lrs.rb | 1 + ...metadata_google.cloud.texttospeech.v1.json | 12 +- .../snippets/text_to_speech/list_voices.rb | 9 +- .../text_to_speech/synthesize_speech.rb | 9 +- .../synthesize_long_audio.rb | 7 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 .../AUTHENTICATION.md | 173 +- ...oogle-cloud-text_to_speech-v1beta1.gemspec | 2 +- .../v1beta1/text_to_speech/client.rb | 39 +- .../v1beta1/text_to_speech/rest/client.rb | 40 +- .../text_to_speech/rest/service_stub.rb | 16 +- .../client.rb | 40 +- .../operations.rb | 34 +- .../rest/client.rb | 41 +- .../rest/operations.rb | 41 +- .../rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../cloud/texttospeech/v1beta1/cloud_tts.rb | 1 + .../texttospeech/v1beta1/cloud_tts_lrs.rb | 1 + ...ata_google.cloud.texttospeech.v1beta1.json | 12 +- .../snippets/text_to_speech/list_voices.rb | 9 +- .../text_to_speech/synthesize_speech.rb | 7 +- .../synthesize_long_audio.rb | 7 +- google-cloud-tpu-v1/.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-tpu-v1/AUTHENTICATION.md | 173 +- .../google-cloud-tpu-v1.gemspec | 4 +- .../lib/google/cloud/tpu/v1/tpu/client.rb | 41 +- .../lib/google/cloud/tpu/v1/tpu/operations.rb | 34 +- .../proto_docs/google/api/client.rb | 1 + .../google/cloud/tpu/v1/cloud_tpu.rb | 2 + .../snippet_metadata_google.cloud.tpu.v1.json | 44 +- .../snippets/tpu/create_node.rb | 9 +- .../snippets/tpu/delete_node.rb | 9 +- .../snippets/tpu/get_accelerator_type.rb | 9 +- google-cloud-tpu-v1/snippets/tpu/get_node.rb | 9 +- .../snippets/tpu/get_tensor_flow_version.rb | 9 +- .../snippets/tpu/list_accelerator_types.rb | 9 +- .../snippets/tpu/list_nodes.rb | 9 +- .../snippets/tpu/list_tensor_flow_versions.rb | 9 +- .../snippets/tpu/reimage_node.rb | 9 +- .../snippets/tpu/start_node.rb | 9 +- google-cloud-tpu-v1/snippets/tpu/stop_node.rb | 9 +- google-cloud-trace-v1/.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-trace-v1/AUTHENTICATION.md | 173 +- .../google-cloud-trace-v1.gemspec | 2 +- .../cloud/trace/v1/trace_service/client.rb | 39 +- .../trace/v1/trace_service/rest/client.rb | 40 +- .../v1/trace_service/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + ...etadata_google.devtools.cloudtrace.v1.json | 12 +- .../snippets/trace_service/get_trace.rb | 9 +- .../snippets/trace_service/list_traces.rb | 9 +- .../snippets/trace_service/patch_traces.rb | 9 +- google-cloud-trace-v2/.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-trace-v2/AUTHENTICATION.md | 173 +- .../google-cloud-trace-v2.gemspec | 2 +- .../cloud/trace/v2/trace_service/client.rb | 39 +- .../trace/v2/trace_service/rest/client.rb | 40 +- .../v2/trace_service/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + ...etadata_google.devtools.cloudtrace.v2.json | 8 +- .../trace_service/batch_write_spans.rb | 9 +- .../snippets/trace_service/create_span.rb | 9 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 google-cloud-translate-v3/AUTHENTICATION.md | 173 +- .../google-cloud-translate-v3.gemspec | 2 +- .../v3/translation_service/client.rb | 40 +- .../v3/translation_service/operations.rb | 34 +- .../v3/translation_service/rest/client.rb | 41 +- .../v3/translation_service/rest/operations.rb | 41 +- .../translation_service/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + ..._metadata_google.cloud.translation.v3.json | 80 +- .../adaptive_mt_translate.rb | 7 +- .../batch_translate_document.rb | 7 +- .../batch_translate_text.rb | 7 +- .../create_adaptive_mt_dataset.rb | 7 +- .../translation_service/create_glossary.rb | 9 +- .../delete_adaptive_mt_dataset.rb | 7 +- .../delete_adaptive_mt_file.rb | 7 +- .../translation_service/delete_glossary.rb | 9 +- .../translation_service/detect_language.rb | 9 +- .../get_adaptive_mt_dataset.rb | 7 +- .../get_adaptive_mt_file.rb | 7 +- .../translation_service/get_glossary.rb | 9 +- .../get_supported_languages.rb | 7 +- .../import_adaptive_mt_file.rb | 7 +- .../list_adaptive_mt_datasets.rb | 7 +- .../list_adaptive_mt_files.rb | 7 +- .../list_adaptive_mt_sentences.rb | 7 +- .../translation_service/list_glossaries.rb | 9 +- .../translation_service/translate_document.rb | 7 +- .../translation_service/translate_text.rb | 9 +- .../.owlbot-manifest.json | 1 + .../.toys.rb | 0 .../AUTHENTICATION.md | 171 +- .../google-cloud-video-live_stream-v1.gemspec | 4 +- .../v1/livestream_service/client.rb | 41 +- .../v1/livestream_service/operations.rb | 34 +- .../v1/livestream_service/rest/client.rb | 42 +- .../v1/livestream_service/rest/operations.rb | 41 +- .../livestream_service/rest/service_stub.rb | 16 +- .../proto_docs/google/api/client.rb | 1 + .../livestream_service/create_asset.rb | 7 +- .../livestream_service/create_channel.rb | 7 +- .../livestream_service/create_event.rb | 7 +- .../livestream_service/create_input.rb | 7 +- .../livestream_service/delete_asset.rb | 7 +- .../livestream_service/delete_channel.rb | 7 +- .../livestream_service/delete_event.rb | 7 +- .../livestream_service/delete_input.rb | 7 +- .../snippets/livestream_service/get_asset.rb | 9 +- .../livestream_service/get_channel.rb | 7 +- .../snippets/livestream_service/get_event.rb | 9 +- .../snippets/livestream_service/get_input.rb | 9 +- .../snippets/livestream_service/get_pool.rb | 9 +- .../livestream_service/list_assets.rb | 7 +- .../livestream_service/list_channels.rb | 7 +- .../livestream_service/list_events.rb | 7 +- .../livestream_service/list_inputs.rb | 7 +- .../livestream_service/start_channel.rb | 7 +- .../livestream_service/stop_channel.rb | 7 +- .../livestream_service/update_channel.rb | 7 +- .../livestream_service/update_input.rb | 7 +- .../livestream_service/update_pool.rb | 7 +- ...data_google.cloud.video.livestream.v1.json | 88 +- .../google-cloud-talent-v4/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-talent-v4/.rubocop.yml | 33 - .../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 | 3 - .../google-cloud-talent-v4/LICENSE.md | 201 - .../google-cloud-talent-v4/README.md | 144 - .../google-cloud-talent-v4/Rakefile | 201 - .../gapic_metadata.json | 164 - .../google-cloud-talent-v4.gemspec | 37 - .../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 | 855 ---- .../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 | 794 ---- .../v4/company_service/rest/service_stub.rb | 357 -- .../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 | 457 -- .../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 | 424 -- .../talent/v4/completion/rest/service_stub.rb | 119 - .../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 | 435 -- .../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 | 402 -- .../v4/event_service/rest/service_stub.rb | 120 - .../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 | 1993 --------- .../talent/v4/job_service/credentials.rb | 52 - .../cloud/talent/v4/job_service/operations.rb | 801 ---- .../cloud/talent/v4/job_service/paths.rb | 88 - .../cloud/talent/v4/job_service/rest.rb | 53 - .../talent/v4/job_service/rest/client.rb | 1897 -------- .../talent/v4/job_service/rest/operations.rb | 895 ---- .../v4/job_service/rest/service_stub.rb | 657 --- .../google/cloud/talent/v4/job_service_pb.rb | 85 - .../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 | 843 ---- .../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 | 782 ---- .../v4/tenant_service/rest/service_stub.rb | 357 -- .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/cloud/talent/v4/common.rb | 955 ---- .../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 | 387 -- .../google/cloud/talent/v4/histogram.rb | 72 - .../proto_docs/google/cloud/talent/v4/job.rb | 388 -- .../google/cloud/talent/v4/job_service.rb | 901 ---- .../google/cloud/talent/v4/tenant.rb | 50 - .../google/cloud/talent/v4/tenant_service.rb | 121 - .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 49 - .../talent/v4/company_service_rest_test.rb | 357 -- .../cloud/talent/v4/company_service_test.rb | 372 -- .../cloud/talent/v4/completion_paths_test.rb | 49 - .../cloud/talent/v4/completion_rest_test.rb | 142 - .../google/cloud/talent/v4/completion_test.rb | 137 - .../talent/v4/event_service_paths_test.rb | 37 - .../talent/v4/event_service_rest_test.rb | 137 - .../cloud/talent/v4/event_service_test.rb | 127 - .../talent/v4/job_service_operations_test.rb | 380 -- .../cloud/talent/v4/job_service_paths_test.rb | 61 - .../cloud/talent/v4/job_service_rest_test.rb | 660 --- .../cloud/talent/v4/job_service_test.rb | 756 ---- .../talent/v4/tenant_service_paths_test.rb | 49 - .../talent/v4/tenant_service_rest_test.rb | 356 -- .../cloud/talent/v4/tenant_service_test.rb | 370 -- .../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/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-talent-v4beta1/CHANGELOG.md | 2 - .../google-cloud-talent-v4beta1/Gemfile | 3 - .../google-cloud-talent-v4beta1/LICENSE.md | 201 - .../google-cloud-talent-v4beta1/README.md | 144 - .../google-cloud-talent-v4beta1/Rakefile | 201 - .../gapic_metadata.json | 164 - .../google-cloud-talent-v4beta1.gemspec | 37 - .../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 | 866 ---- .../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 | 805 ---- .../company_service/rest/service_stub.rb | 394 -- .../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 | 463 -- .../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 | 430 -- .../v4beta1/completion/rest/service_stub.rb | 126 - .../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 | 436 -- .../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 | 403 -- .../event_service/rest/service_stub.rb | 128 - .../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 | 2015 --------- .../talent/v4beta1/job_service/credentials.rb | 52 - .../talent/v4beta1/job_service/operations.rb | 801 ---- .../cloud/talent/v4beta1/job_service/paths.rb | 146 - .../cloud/talent/v4beta1/job_service/rest.rb | 53 - .../talent/v4beta1/job_service/rest/client.rb | 1919 -------- .../v4beta1/job_service/rest/operations.rb | 895 ---- .../v4beta1/job_service/rest/service_stub.rb | 733 --- .../cloud/talent/v4beta1/job_service_pb.rb | 83 - .../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 | 845 ---- .../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 | 784 ---- .../tenant_service/rest/service_stub.rb | 357 -- .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/cloud/talent/v4beta1/common.rb | 951 ---- .../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 | 400 -- .../google/cloud/talent/v4beta1/histogram.rb | 74 - .../google/cloud/talent/v4beta1/job.rb | 389 -- .../cloud/talent/v4beta1/job_service.rb | 886 ---- .../google/cloud/talent/v4beta1/tenant.rb | 81 - .../cloud/talent/v4beta1/tenant_service.rb | 123 - .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 64 - .../v4beta1/company_service_rest_test.rb | 357 -- .../talent/v4beta1/company_service_test.rb | 372 -- .../talent/v4beta1/completion_paths_test.rb | 64 - .../talent/v4beta1/completion_rest_test.rb | 142 - .../cloud/talent/v4beta1/completion_test.rb | 137 - .../v4beta1/event_service_paths_test.rb | 49 - .../talent/v4beta1/event_service_rest_test.rb | 137 - .../talent/v4beta1/event_service_test.rb | 127 - .../v4beta1/job_service_operations_test.rb | 380 -- .../talent/v4beta1/job_service_paths_test.rb | 79 - .../talent/v4beta1/job_service_rest_test.rb | 662 --- .../cloud/talent/v4beta1/job_service_test.rb | 755 ---- .../v4beta1/tenant_service_paths_test.rb | 49 - .../v4beta1/tenant_service_rest_test.rb | 356 -- .../talent/v4beta1/tenant_service_test.rb | 370 -- .../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/.yardopts | 12 - .../google-cloud-talent/AUTHENTICATION.md | 122 - .../google-cloud-talent/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-talent/Gemfile | 6 - .../google-cloud-talent/LICENSE.md | 201 - owl-bot-staging/google-cloud-talent/README.md | 113 - owl-bot-staging/google-cloud-talent/Rakefile | 201 - .../google-cloud-talent.gemspec | 37 - .../lib/google-cloud-talent.rb | 19 - .../lib/google/cloud/talent.rb | 255 -- .../lib/google/cloud/talent/version.rb | 26 - .../test/google/cloud/talent/client_test.rb | 120 - .../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/.yardopts | 12 - .../google-cloud-tasks-v2/AUTHENTICATION.md | 122 - .../google-cloud-tasks-v2/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tasks-v2/Gemfile | 3 - .../google-cloud-tasks-v2/LICENSE.md | 201 - .../google-cloud-tasks-v2/README.md | 144 - .../google-cloud-tasks-v2/Rakefile | 201 - .../google-cloud-tasks-v2/gapic_metadata.json | 98 - .../google-cloud-tasks-v2.gemspec | 39 - .../lib/google-cloud-tasks-v2.rb | 21 - .../lib/google/cloud/tasks/v2.rb | 45 - .../cloud/tasks/v2/bindings_override.rb | 102 - .../lib/google/cloud/tasks/v2/cloud_tasks.rb | 56 - .../cloud/tasks/v2/cloud_tasks/client.rb | 2203 --------- .../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 | 2073 --------- .../tasks/v2/cloud_tasks/rest/service_stub.rb | 1014 ----- .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/cloud/tasks/v2/cloudtasks.rb | 375 -- .../proto_docs/google/cloud/tasks/v2/queue.rb | 376 -- .../google/cloud/tasks/v2/target.rb | 462 -- .../proto_docs/google/cloud/tasks/v2/task.rb | 192 - .../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 | 144 - .../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 | 61 - .../cloud/tasks/v2/cloud_tasks_rest_test.rb | 962 ---- .../google/cloud/tasks/v2/cloud_tasks_test.rb | 1037 ----- .../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/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-tasks-v2beta2/CHANGELOG.md | 2 - .../google-cloud-tasks-v2beta2/Gemfile | 3 - .../google-cloud-tasks-v2beta2/LICENSE.md | 201 - .../google-cloud-tasks-v2beta2/README.md | 144 - .../google-cloud-tasks-v2beta2/Rakefile | 201 - .../gapic_metadata.json | 128 - .../google-cloud-tasks-v2beta2.gemspec | 39 - .../lib/google-cloud-tasks-v2beta2.rb | 21 - .../lib/google/cloud/tasks/v2beta2.rb | 45 - .../cloud/tasks/v2beta2/bindings_override.rb | 102 - .../google/cloud/tasks/v2beta2/cloud_tasks.rb | 56 - .../cloud/tasks/v2beta2/cloud_tasks/client.rb | 2998 ------------- .../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 | 2736 ------------ .../v2beta2/cloud_tasks/rest/service_stub.rb | 1315 ------ .../cloud/tasks/v2beta2/cloudtasks_pb.rb | 84 - .../tasks/v2beta2/cloudtasks_services_pb.rb | 286 -- .../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 | 395 -- .../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 | 222 - .../google/cloud/tasks/v2beta2/cloudtasks.rb | 642 --- .../google/cloud/tasks/v2beta2/queue.rb | 438 -- .../google/cloud/tasks/v2beta2/target.rb | 767 ---- .../google/cloud/tasks/v2beta2/task.rb | 202 - .../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 | 144 - .../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/buffer_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 | 895 ---- .../tasks/v2beta2/cloud_tasks_paths_test.rb | 61 - .../tasks/v2beta2/cloud_tasks_rest_test.rb | 1246 ------ .../cloud/tasks/v2beta2/cloud_tasks_test.rb | 1416 ------ .../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/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-tasks-v2beta3/CHANGELOG.md | 2 - .../google-cloud-tasks-v2beta3/Gemfile | 3 - .../google-cloud-tasks-v2beta3/LICENSE.md | 201 - .../google-cloud-tasks-v2beta3/README.md | 144 - .../google-cloud-tasks-v2beta3/Rakefile | 201 - .../gapic_metadata.json | 103 - .../google-cloud-tasks-v2beta3.gemspec | 39 - .../lib/google-cloud-tasks-v2beta3.rb | 21 - .../lib/google/cloud/tasks/v2beta3.rb | 45 - .../cloud/tasks/v2beta3/bindings_override.rb | 102 - .../google/cloud/tasks/v2beta3/cloud_tasks.rb | 56 - .../cloud/tasks/v2beta3/cloud_tasks/client.rb | 2339 ---------- .../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 | 2199 --------- .../v2beta3/cloud_tasks/rest/service_stub.rb | 1075 ----- .../cloud/tasks/v2beta3/cloudtasks_pb.rb | 74 - .../tasks/v2beta3/cloudtasks_services_pb.rb | 220 - .../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 | 395 -- .../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 | 222 - .../google/cloud/tasks/v2beta3/cloudtasks.rb | 429 -- .../google/cloud/tasks/v2beta3/queue.rb | 462 -- .../google/cloud/tasks/v2beta3/target.rb | 720 --- .../google/cloud/tasks/v2beta3/task.rb | 207 - .../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 | 144 - .../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/buffer_task.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/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 | 695 --- .../tasks/v2beta3/cloud_tasks_paths_test.rb | 61 - .../tasks/v2beta3/cloud_tasks_rest_test.rb | 1020 ----- .../cloud/tasks/v2beta3/cloud_tasks_test.rb | 1103 ----- .../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/.yardopts | 12 - .../google-cloud-tasks/AUTHENTICATION.md | 122 - .../google-cloud-tasks/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tasks/Gemfile | 7 - owl-bot-staging/google-cloud-tasks/LICENSE.md | 201 - owl-bot-staging/google-cloud-tasks/README.md | 114 - owl-bot-staging/google-cloud-tasks/Rakefile | 201 - .../google-cloud-tasks.gemspec | 38 - .../lib/google-cloud-tasks.rb | 19 - .../lib/google/cloud/tasks.rb | 120 - .../lib/google/cloud/tasks/version.rb | 26 - .../test/google/cloud/tasks/client_test.rb | 44 - .../test/google/cloud/tasks/version_test.rb | 26 - .../google-cloud-tasks/test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-telco_automation-v1/Gemfile | 3 - .../LICENSE.md | 201 - .../README.md | 144 - .../google-cloud-telco_automation-v1/Rakefile | 201 - .../gapic_metadata.json | 198 - .../google-cloud-telco_automation-v1.gemspec | 38 - .../lib/google-cloud-telco_automation-v1.rb | 21 - .../lib/google/cloud/telco_automation/v1.rb | 45 - .../telco_automation/v1/bindings_override.rb | 102 - .../google/cloud/telco_automation/v1/rest.rb | 38 - .../telco_automation/v1/telco_automation.rb | 60 - .../v1/telco_automation/client.rb | 3971 ----------------- .../v1/telco_automation/credentials.rb | 47 - .../v1/telco_automation/operations.rb | 801 ---- .../v1/telco_automation/paths.rb | 172 - .../v1/telco_automation/rest.rb | 58 - .../v1/telco_automation/rest/client.rb | 3699 --------------- .../v1/telco_automation/rest/operations.rb | 895 ---- .../v1/telco_automation/rest/service_stub.rb | 2200 --------- .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../telcoautomation/v1/telcoautomation.rb | 1534 ------- .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 380 -- .../v1/telco_automation_paths_test.rb | 109 - .../v1/telco_automation_rest_test.rb | 2072 --------- .../v1/telco_automation_test.rb | 2330 ---------- .../test/helper.rb | 25 - .../google-cloud-telco_automation/.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 39 - .../google-cloud-telco_automation/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-telco_automation/Gemfile | 5 - .../google-cloud-telco_automation/LICENSE.md | 201 - .../google-cloud-telco_automation/README.md | 104 - .../google-cloud-telco_automation/Rakefile | 201 - .../google-cloud-telco_automation.gemspec | 36 - .../lib/google-cloud-telco_automation.rb | 19 - .../lib/google/cloud/telco_automation.rb | 123 - .../google/cloud/telco_automation/version.rb | 26 - .../cloud/telco_automation/client_test.rb | 44 - .../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/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-text_to_speech-v1/Gemfile | 3 - .../google-cloud-text_to_speech-v1/LICENSE.md | 201 - .../google-cloud-text_to_speech-v1/README.md | 144 - .../google-cloud-text_to_speech-v1/Rakefile | 201 - .../gapic_metadata.json | 42 - .../google-cloud-text_to_speech-v1.gemspec | 37 - .../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 | 514 --- .../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 | 490 -- .../v1/text_to_speech/rest/service_stub.rb | 175 - .../text_to_speech_long_audio_synthesize.rb | 56 - .../client.rb | 457 -- .../credentials.rb | 51 - .../operations.rb | 801 ---- .../paths.rb | 52 - .../rest.rb | 53 - .../rest/client.rb | 424 -- .../rest/operations.rb | 895 ---- .../rest/service_stub.rb | 120 - .../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 | 58 - .../texttospeech/v1/cloud_tts_services_pb.rb | 48 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/cloud/texttospeech/v1/cloud_tts.rb | 278 -- .../cloud/texttospeech/v1/cloud_tts_lrs.rb | 74 - .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 135 - .../snippets/text_to_speech/list_voices.rb | 47 - .../text_to_speech/synthesize_speech.rb | 47 - .../synthesize_long_audio.rb | 54 - ...h_long_audio_synthesize_operations_test.rb | 380 -- ...speech_long_audio_synthesize_paths_test.rb | 37 - ..._speech_long_audio_synthesize_rest_test.rb | 140 - ...xt_to_speech_long_audio_synthesize_test.rb | 151 - .../v1/text_to_speech_paths_test.rb | 37 - .../v1/text_to_speech_rest_test.rb | 192 - .../text_to_speech/v1/text_to_speech_test.rb | 187 - .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 3 - .../LICENSE.md | 201 - .../README.md | 144 - .../Rakefile | 201 - .../gapic_metadata.json | 42 - ...oogle-cloud-text_to_speech-v1beta1.gemspec | 37 - .../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 | 516 --- .../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 | 492 -- .../text_to_speech/rest/service_stub.rb | 175 - .../text_to_speech_long_audio_synthesize.rb | 56 - .../client.rb | 457 -- .../credentials.rb | 51 - .../operations.rb | 801 ---- .../paths.rb | 52 - .../rest.rb | 53 - .../rest/client.rb | 424 -- .../rest/operations.rb | 895 ---- .../rest/service_stub.rb | 120 - .../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 | 60 - .../v1beta1/cloud_tts_services_pb.rb | 48 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../cloud/texttospeech/v1beta1/cloud_tts.rb | 313 -- .../texttospeech/v1beta1/cloud_tts_lrs.rb | 74 - .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 135 - .../snippets/text_to_speech/list_voices.rb | 47 - .../text_to_speech/synthesize_speech.rb | 47 - .../synthesize_long_audio.rb | 54 - ...h_long_audio_synthesize_operations_test.rb | 380 -- ...speech_long_audio_synthesize_paths_test.rb | 37 - ..._speech_long_audio_synthesize_rest_test.rb | 140 - ...xt_to_speech_long_audio_synthesize_test.rb | 151 - .../v1beta1/text_to_speech_paths_test.rb | 37 - .../v1beta1/text_to_speech_rest_test.rb | 193 - .../v1beta1/text_to_speech_test.rb | 189 - .../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/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-text_to_speech/CHANGELOG.md | 2 - .../google-cloud-text_to_speech/Gemfile | 6 - .../google-cloud-text_to_speech/LICENSE.md | 201 - .../google-cloud-text_to_speech/README.md | 113 - .../google-cloud-text_to_speech/Rakefile | 201 - .../google-cloud-text_to_speech.gemspec | 37 - .../lib/google-cloud-text_to_speech.rb | 19 - .../lib/google/cloud/text_to_speech.rb | 153 - .../google/cloud/text_to_speech/version.rb | 26 - .../cloud/text_to_speech/client_test.rb | 63 - .../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/.yardopts | 12 - .../google-cloud-tpu-v1/AUTHENTICATION.md | 122 - .../google-cloud-tpu-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tpu-v1/Gemfile | 3 - .../google-cloud-tpu-v1/LICENSE.md | 201 - owl-bot-staging/google-cloud-tpu-v1/README.md | 144 - owl-bot-staging/google-cloud-tpu-v1/Rakefile | 201 - .../google-cloud-tpu-v1/gapic_metadata.json | 73 - .../google-cloud-tpu-v1.gemspec | 38 - .../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 | 1455 ------ .../google/cloud/tpu/v1/tpu/credentials.rb | 51 - .../lib/google/cloud/tpu/v1/tpu/operations.rb | 801 ---- .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/cloud/tpu/v1/cloud_tpu.rb | 518 --- .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 380 -- .../google/cloud/tpu/v1/tpu_paths_test.rb | 73 - .../test/google/cloud/tpu/v1/tpu_test.rb | 784 ---- .../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 | 5 - owl-bot-staging/google-cloud-tpu/LICENSE.md | 201 - owl-bot-staging/google-cloud-tpu/README.md | 130 - owl-bot-staging/google-cloud-tpu/Rakefile | 201 - .../google-cloud-tpu/google-cloud-tpu.gemspec | 36 - .../google-cloud-tpu/lib/google-cloud-tpu.rb | 19 - .../google-cloud-tpu/lib/google/cloud/tpu.rb | 117 - .../lib/google/cloud/tpu/version.rb | 26 - .../test/google/cloud/tpu/client_test.rb | 34 - .../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 | 3 - .../google-cloud-trace-v1/LICENSE.md | 201 - .../google-cloud-trace-v1/README.md | 144 - .../google-cloud-trace-v1/Rakefile | 201 - .../google-cloud-trace-v1/gapic_metadata.json | 33 - .../google-cloud-trace-v1.gemspec | 37 - .../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 | 699 --- .../trace/v1/trace_service/credentials.rb | 53 - .../cloud/trace/v1/trace_service/rest.rb | 55 - .../trace/v1/trace_service/rest/client.rb | 649 --- .../v1/trace_service/rest/service_stub.rb | 239 - .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../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 | 253 -- .../cloud/trace/v1/trace_service_test.rb | 264 -- .../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 | 3 - .../google-cloud-trace-v2/LICENSE.md | 201 - .../google-cloud-trace-v2/README.md | 144 - .../google-cloud-trace-v2/Rakefile | 201 - .../google-cloud-trace-v2/gapic_metadata.json | 28 - .../google-cloud-trace-v2.gemspec | 37 - .../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 | 590 --- .../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 | 550 --- .../v2/trace_service/rest/service_stub.rb | 180 - .../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 | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/devtools/cloudtrace/v2/trace.rb | 417 -- .../google/devtools/cloudtrace/v2/tracing.rb | 40 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 49 - .../cloud/trace/v2/trace_service_rest_test.rb | 204 - .../cloud/trace/v2/trace_service_test.rb | 211 - .../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 | 3 - .../google-cloud-translate-v3/LICENSE.md | 201 - .../google-cloud-translate-v3/README.md | 144 - .../google-cloud-translate-v3/Rakefile | 201 - .../gapic_metadata.json | 118 - .../google-cloud-translate-v3.gemspec | 37 - .../lib/google-cloud-translate-v3.rb | 21 - .../lib/google/cloud/translate/v3.rb | 45 - .../cloud/translate/v3/adaptive_mt_pb.rb | 67 - .../google/cloud/translate/v3/common_pb.rb | 46 - .../lib/google/cloud/translate/v3/rest.rb | 37 - .../cloud/translate/v3/translation_service.rb | 56 - .../v3/translation_service/client.rb | 2680 ----------- .../v3/translation_service/credentials.rb | 52 - .../v3/translation_service/operations.rb | 809 ---- .../translate/v3/translation_service/paths.rb | 109 - .../translate/v3/translation_service/rest.rb | 53 - .../v3/translation_service/rest/client.rb | 2514 ----------- .../v3/translation_service/rest/operations.rb | 1060 ----- .../translation_service/rest/service_stub.rb | 1279 ------ .../translate/v3/translation_service_pb.rb | 94 - .../v3/translation_service_services_pb.rb | 104 - .../lib/google/cloud/translate/v3/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../google/cloud/translate/v3/adaptive_mt.rb | 327 -- .../google/cloud/translate/v3/common.rb | 61 - .../cloud/translate/v3/translation_service.rb | 1439 ------ .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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.translation.v3.json | 815 ---- .../adaptive_mt_translate.rb | 47 - .../batch_translate_document.rb | 54 - .../batch_translate_text.rb | 54 - .../create_adaptive_mt_dataset.rb | 47 - .../translation_service/create_glossary.rb | 54 - .../delete_adaptive_mt_dataset.rb | 47 - .../delete_adaptive_mt_file.rb | 47 - .../translation_service/delete_glossary.rb | 54 - .../translation_service/detect_language.rb | 47 - .../get_adaptive_mt_dataset.rb | 47 - .../get_adaptive_mt_file.rb | 47 - .../translation_service/get_glossary.rb | 47 - .../get_supported_languages.rb | 47 - .../import_adaptive_mt_file.rb | 47 - .../list_adaptive_mt_datasets.rb | 51 - .../list_adaptive_mt_files.rb | 51 - .../list_adaptive_mt_sentences.rb | 51 - .../translation_service/list_glossaries.rb | 51 - .../translation_service/translate_document.rb | 47 - .../translation_service/translate_text.rb | 47 - .../v3/translation_service_operations_test.rb | 380 -- .../v3/translation_service_paths_test.rb | 73 - .../v3/translation_service_rest_test.rb | 1218 ----- .../translate/v3/translation_service_test.rb | 1394 ------ .../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 | 6 - .../google-cloud-translate/LICENSE.md | 201 - .../google-cloud-translate/README.md | 113 - .../google-cloud-translate/Rakefile | 201 - .../google-cloud-translate.gemspec | 37 - .../lib/google-cloud-translate.rb | 19 - .../lib/google/cloud/translate.rb | 119 - .../lib/google/cloud/translate/version.rb | 26 - .../google/cloud/translate/client_test.rb | 44 - .../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 | 3 - .../LICENSE.md | 201 - .../README.md | 144 - .../Rakefile | 201 - .../gapic_metadata.json | 128 - .../google-cloud-video-live_stream-v1.gemspec | 38 - .../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 | 104 - .../live_stream/v1/livestream_service.rb | 62 - .../v1/livestream_service/client.rb | 2870 ------------ .../v1/livestream_service/credentials.rb | 49 - .../v1/livestream_service/operations.rb | 803 ---- .../v1/livestream_service/paths.rb | 185 - .../live_stream/v1/livestream_service/rest.rb | 60 - .../v1/livestream_service/rest/client.rb | 2694 ----------- .../v1/livestream_service/rest/operations.rb | 897 ---- .../livestream_service/rest/service_stub.rb | 1369 ------ .../google/cloud/video/live_stream/v1/rest.rb | 40 - .../cloud/video/live_stream/v1/version.rb | 30 - .../cloud/video/livestream/v1/outputs_pb.rb | 66 - .../cloud/video/livestream/v1/resources_pb.rb | 96 - .../cloud/video/livestream/v1/service_pb.rb | 84 - .../livestream/v1/service_services_pb.rb | 97 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 395 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 - .../cloud/video/livestream/v1/outputs.rb | 509 --- .../cloud/video/livestream/v1/resources.rb | 813 ---- .../cloud/video/livestream/v1/service.rb | 684 --- .../google/longrunning/operations.rb | 164 - .../proto_docs/google/protobuf/any.rb | 144 - .../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 | 99 - .../snippets/Gemfile | 32 - .../livestream_service/create_asset.rb | 54 - .../livestream_service/create_channel.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_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_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 - .../livestream_service/list_events.rb | 51 - .../livestream_service/list_inputs.rb | 51 - .../livestream_service/start_channel.rb | 54 - .../livestream_service/stop_channel.rb | 54 - .../livestream_service/update_channel.rb | 54 - .../livestream_service/update_input.rb | 54 - .../livestream_service/update_pool.rb | 54 - ...data_google.cloud.video.livestream.v1.json | 895 ---- .../v1/livestream_service_operations_test.rb | 380 -- .../v1/livestream_service_paths_test.rb | 121 - .../v1/livestream_service_rest_test.rb | 1311 ------ .../live_stream/v1/livestream_service_test.rb | 1513 ------- .../test/helper.rb | 25 - .../google-cloud-video-live_stream/.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 39 - .../google-cloud-video-live_stream/.toys.rb | 28 - .../google-cloud-video-live_stream/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-video-live_stream/Gemfile | 5 - .../google-cloud-video-live_stream/LICENSE.md | 201 - .../google-cloud-video-live_stream/README.md | 104 - .../google-cloud-video-live_stream/Rakefile | 201 - .../google-cloud-video-live_stream.gemspec | 36 - .../lib/google-cloud-video-live_stream.rb | 19 - .../lib/google/cloud/video/live_stream.rb | 125 - .../google/cloud/video/live_stream/version.rb | 28 - .../cloud/video/live_stream/client_test.rb | 44 - .../cloud/video/live_stream/version_test.rb | 26 - .../test/helper.rb | 25 - 1491 files changed, 4947 insertions(+), 209782 deletions(-) rename {owl-bot-staging/google-cloud-talent-v4 => google-cloud-talent-v4}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-talent-v4beta1 => google-cloud-talent-v4beta1}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-talent => google-cloud-tasks-v2}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-tasks-v2 => google-cloud-tasks-v2beta2}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-tasks-v2beta2 => google-cloud-tasks-v2beta3}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-tasks-v2beta3 => google-cloud-telco_automation-v1}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-tasks => google-cloud-text_to_speech-v1}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-telco_automation-v1 => google-cloud-text_to_speech-v1beta1}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-telco_automation => google-cloud-tpu-v1}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-text_to_speech-v1 => google-cloud-trace-v1}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-text_to_speech-v1beta1 => google-cloud-trace-v2}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-text_to_speech => google-cloud-translate-v3}/.toys.rb (100%) rename {owl-bot-staging/google-cloud-tpu-v1 => google-cloud-video-live_stream-v1}/.toys.rb (100%) 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/.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/.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/.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/.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/.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/buffer_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/.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/httpbody.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/buffer_task.rb 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/.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/.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/.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/.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/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/.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/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/.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/.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/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/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/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_glossary.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_glossary.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/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_glossary.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/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_glossaries.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/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/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_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_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_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_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/start_channel.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/update_channel.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 delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/.gitignore delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/.yardopts delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/Gemfile delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/README.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/Rakefile delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/google-cloud-video-live_stream.gemspec delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream/test/helper.rb diff --git a/google-cloud-talent-v4/.owlbot-manifest.json b/google-cloud-talent-v4/.owlbot-manifest.json index 19299f019fdf..e781295097e6 100644 --- a/google-cloud-talent-v4/.owlbot-manifest.json +++ b/google-cloud-talent-v4/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-talent-v4/.toys.rb b/google-cloud-talent-v4/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-talent-v4/.toys.rb rename to google-cloud-talent-v4/.toys.rb diff --git a/google-cloud-talent-v4/AUTHENTICATION.md b/google-cloud-talent-v4/AUTHENTICATION.md index e27160978fa5..3ee7d3b9820d 100644 --- a/google-cloud-talent-v4/AUTHENTICATION.md +++ b/google-cloud-talent-v4/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-talent-v4 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TALENT_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/talent/v4" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-talent-v4 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-talent-v4 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Talent::V4::CompanyService::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TALENT_CREDENTIALS` - Path to JSON file, or JSON contents -* `TALENT_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/talent/v4" - -ENV["TALENT_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Talent::V4::CompanyService::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/talent/v4" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-talent-v4. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Talent::V4::CompanyService::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-talent-v4/google-cloud-talent-v4.gemspec b/google-cloud-talent-v4/google-cloud-talent-v4.gemspec index 551902422064..958fa9498817 100644 --- a/google-cloud-talent-v4/google-cloud-talent-v4.gemspec +++ b/google-cloud-talent-v4/google-cloud-talent-v4.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb index 252da25379e9..4070b24825fb 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb @@ -30,6 +30,9 @@ module CompanyService # A service that handles company management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -109,6 +112,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @company_service_stub.universe_domain + end + ## # Create a new CompanyService client object. # @@ -142,8 +154,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -154,8 +167,10 @@ def initialize @company_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4::CompanyService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -666,9 +681,9 @@ def list_companies request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -714,13 +729,20 @@ def list_companies request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -735,6 +757,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb index 46512b324b74..1b5bc73f50a6 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service that handles company management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -111,6 +114,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @company_service_stub.universe_domain + end + ## # Create a new CompanyService REST client object. # @@ -138,8 +150,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -149,7 +162,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -621,9 +639,9 @@ def list_companies request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -660,13 +678,20 @@ def list_companies request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -678,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb index 62930b7fb2e9..09d48ad3cf53 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_company REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb index 4447edae4860..e336b5f0382a 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb @@ -30,6 +30,9 @@ module Completion # A service handles auto completion. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -95,6 +98,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_stub.universe_domain + end + ## # Create a new Completion client object. # @@ -128,8 +140,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -140,8 +153,10 @@ def initialize @completion_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4::Completion::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -296,9 +311,9 @@ def complete_query request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -344,13 +359,20 @@ def complete_query request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -365,6 +387,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb index 53ee40b491e1..71a3e7f25434 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service handles auto completion. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -97,6 +100,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_stub.universe_domain + end + ## # Create a new Completion REST client object. # @@ -124,8 +136,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -135,7 +148,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -279,9 +297,9 @@ def complete_query request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -318,13 +336,20 @@ def complete_query request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -336,6 +361,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb index cd78f2a7dd7c..bde0d14f5784 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb index 9a9fbbe90c7e..dea47f8c7cd2 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb @@ -30,6 +30,9 @@ module EventService # A service handles client event report. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -92,6 +95,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @event_service_stub.universe_domain + end + ## # Create a new EventService client object. # @@ -125,8 +137,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -137,8 +150,10 @@ def initialize @event_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4::EventService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -274,9 +289,9 @@ def create_client_event request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -322,13 +337,20 @@ def create_client_event request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -343,6 +365,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb index e0ac68e9daee..d14f246803d6 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service handles client event report. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -94,6 +97,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @event_service_stub.universe_domain + end + ## # Create a new EventService REST client object. # @@ -121,8 +133,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -132,7 +145,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -257,9 +275,9 @@ def create_client_event request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -296,13 +314,20 @@ def create_client_event request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -314,6 +339,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb index 728959b30120..c26242c009ce 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_client_event REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb index 196e3ac5a1b2..289985c387ed 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb @@ -30,6 +30,9 @@ module JobService # A service handles job management, including job CRUD, enumeration and search. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -117,6 +120,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_service_stub.universe_domain + end + ## # Create a new JobService client object. # @@ -150,8 +162,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -164,12 +177,15 @@ def initialize 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, + 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 @@ -1768,9 +1784,9 @@ def search_jobs_for_alert request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -1816,13 +1832,20 @@ def search_jobs_for_alert request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -1837,6 +1860,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb index 4684269f3844..89eb6f37a5b3 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb @@ -26,6 +26,9 @@ module V4 module JobService # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -613,9 +627,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -661,13 +675,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -682,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb index a1abaf30f397..9b3fc6468153 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service handles job management, including job CRUD, enumeration and search. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -119,6 +122,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_service_stub.universe_domain + end + ## # Create a new JobService REST client object. # @@ -146,8 +158,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -161,9 +174,15 @@ def initialize 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, credentials: credentials + @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 + ) end ## @@ -1688,9 +1707,9 @@ def search_jobs_for_alert request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -1727,13 +1746,20 @@ def search_jobs_for_alert request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -1745,6 +1771,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb index 3821ed1dc503..2dff7131f5ef 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb @@ -26,6 +26,9 @@ module JobService module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -84,8 +96,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -478,9 +492,9 @@ def cancel_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -517,13 +531,20 @@ def cancel_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -535,6 +556,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -617,12 +639,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb index 8d2ca34b0252..b028ff064f0b 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb index 020cd67efa8e..1b87ffca79d1 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb @@ -30,6 +30,9 @@ module TenantService # A service that handles tenant management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -109,6 +112,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @tenant_service_stub.universe_domain + end + ## # Create a new TenantService client object. # @@ -142,8 +154,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -154,8 +167,10 @@ def initialize @tenant_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4::TenantService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -654,9 +669,9 @@ def list_tenants request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -702,13 +717,20 @@ def list_tenants request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -723,6 +745,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb index 6995ea6c82f6..4d29e4c2606e 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service that handles tenant management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -111,6 +114,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @tenant_service_stub.universe_domain + end + ## # Create a new TenantService REST client object. # @@ -138,8 +150,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -149,7 +162,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -609,9 +627,9 @@ def list_tenants request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -648,13 +666,20 @@ def list_tenants request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -666,6 +691,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb index fb6c21d5b338..e031321d1eee 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_tenant REST call # diff --git a/google-cloud-talent-v4/proto_docs/google/api/client.rb b/google-cloud-talent-v4/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-talent-v4/proto_docs/google/api/client.rb +++ b/google-cloud-talent-v4/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb index c81ff106b6f1..fd6bc6a9bd4f 100644 --- a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb +++ b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb @@ -894,6 +894,7 @@ module PostingRegion # 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 diff --git a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb index 32982a73ab98..915827c8fca0 100644 --- a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb +++ b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb @@ -80,6 +80,7 @@ module V4 # @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 diff --git a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb index ac09bbed0d93..6f068237e0b9 100644 --- a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb +++ b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb @@ -211,6 +211,7 @@ module V4 # 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. # diff --git a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb index 87da9e5accab..d7fe02795deb 100644 --- a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb +++ b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb @@ -400,6 +400,7 @@ class ListJobsResponse # 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} diff --git a/google-cloud-talent-v4/snippets/company_service/create_company.rb b/google-cloud-talent-v4/snippets/company_service/create_company.rb index cd841c602d22..c1ca6968e91e 100755 --- a/google-cloud-talent-v4/snippets/company_service/create_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/create_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4::CompanyService::Client#create_company. # def create_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/company_service/delete_company.rb b/google-cloud-talent-v4/snippets/company_service/delete_company.rb index 20c6d405cd49..9cf091b42a76 100755 --- a/google-cloud-talent-v4/snippets/company_service/delete_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/delete_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4::CompanyService::Client#delete_company. # def delete_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/company_service/get_company.rb b/google-cloud-talent-v4/snippets/company_service/get_company.rb index c3477027af5a..aabe2fe3dd25 100755 --- a/google-cloud-talent-v4/snippets/company_service/get_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/get_company.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::CompanyService::Client#get_company. # def get_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/company_service/list_companies.rb b/google-cloud-talent-v4/snippets/company_service/list_companies.rb index 4b07febf3071..cc028ba74f3a 100755 --- a/google-cloud-talent-v4/snippets/company_service/list_companies.rb +++ b/google-cloud-talent-v4/snippets/company_service/list_companies.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4::CompanyService::Client#list_companies. # def list_companies # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/company_service/update_company.rb b/google-cloud-talent-v4/snippets/company_service/update_company.rb index 67d7f9accbf9..7d685637b427 100755 --- a/google-cloud-talent-v4/snippets/company_service/update_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/update_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4::CompanyService::Client#update_company. # def update_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/completion/complete_query.rb b/google-cloud-talent-v4/snippets/completion/complete_query.rb index 32d13a16a2fe..7622d9fc5044 100755 --- a/google-cloud-talent-v4/snippets/completion/complete_query.rb +++ b/google-cloud-talent-v4/snippets/completion/complete_query.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::Completion::Client#complete_query. # def complete_query # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/event_service/create_client_event.rb b/google-cloud-talent-v4/snippets/event_service/create_client_event.rb index 9c69c2980ffd..678f8a480962 100755 --- a/google-cloud-talent-v4/snippets/event_service/create_client_event.rb +++ b/google-cloud-talent-v4/snippets/event_service/create_client_event.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb b/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb index ae35ef7fb218..a3e30e03581d 100755 --- a/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb b/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb index c7ebd7f3434b..22c27bbb1a2d 100755 --- a/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb b/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb index 25ebc1db3d21..18916c46a149 100755 --- a/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4/snippets/job_service/create_job.rb b/google-cloud-talent-v4/snippets/job_service/create_job.rb index 4f8b88495003..c98bf8e3d9b1 100755 --- a/google-cloud-talent-v4/snippets/job_service/create_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/create_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::JobService::Client#create_job. # def create_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/job_service/delete_job.rb b/google-cloud-talent-v4/snippets/job_service/delete_job.rb index 948ad4c97ad4..3acfa761e308 100755 --- a/google-cloud-talent-v4/snippets/job_service/delete_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/delete_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::JobService::Client#delete_job. # def delete_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/job_service/get_job.rb b/google-cloud-talent-v4/snippets/job_service/get_job.rb index 29a2777c2e48..934d93dc85f2 100755 --- a/google-cloud-talent-v4/snippets/job_service/get_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/get_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::JobService::Client#get_job. # def get_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/job_service/list_jobs.rb b/google-cloud-talent-v4/snippets/job_service/list_jobs.rb index 3cbeac469890..8af243daaa38 100755 --- a/google-cloud-talent-v4/snippets/job_service/list_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/list_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::JobService::Client#list_jobs. # def list_jobs # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/job_service/search_jobs.rb b/google-cloud-talent-v4/snippets/job_service/search_jobs.rb index cb9e3ca234a0..7aee46c028b1 100755 --- a/google-cloud-talent-v4/snippets/job_service/search_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/search_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::JobService::Client#search_jobs. # def search_jobs # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb b/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb index dd77aa68bdff..851fd2b4f259 100755 --- a/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb +++ b/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4/snippets/job_service/update_job.rb b/google-cloud-talent-v4/snippets/job_service/update_job.rb index 531a99d8f65e..a30c5820647f 100755 --- a/google-cloud-talent-v4/snippets/job_service/update_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/update_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::JobService::Client#update_job. # def update_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json index 4d5158071b5c..94a4f63157cc 100644 --- a/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json +++ b/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -694,7 +694,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -734,7 +734,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -774,7 +774,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -814,7 +814,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -854,7 +854,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] diff --git a/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb index e1bbfcba04a3..ec87bdce8d83 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::TenantService::Client#create_tenant. # def create_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb index b061dd23a934..4be674d536a9 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::TenantService::Client#delete_tenant. # def delete_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb index 99d09864192a..71ec3173eaa2 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::TenantService::Client#get_tenant. # def get_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb b/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb index 740942709f04..16c158e3962d 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::TenantService::Client#list_tenants. # def list_tenants # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb index c6b962f0e8af..3601d72365bf 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4::TenantService::Client#update_tenant. # def update_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/.owlbot-manifest.json b/google-cloud-talent-v4beta1/.owlbot-manifest.json index 1e2bb3e91c4a..7d86748d7b76 100644 --- a/google-cloud-talent-v4beta1/.owlbot-manifest.json +++ b/google-cloud-talent-v4beta1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb b/google-cloud-talent-v4beta1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb rename to google-cloud-talent-v4beta1/.toys.rb diff --git a/google-cloud-talent-v4beta1/AUTHENTICATION.md b/google-cloud-talent-v4beta1/AUTHENTICATION.md index 338158e61728..26b135cba9b3 100644 --- a/google-cloud-talent-v4beta1/AUTHENTICATION.md +++ b/google-cloud-talent-v4beta1/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-talent-v4beta1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TALENT_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/talent/v4beta1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-talent-v4beta1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-talent-v4beta1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Talent::V4beta1::CompanyService::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TALENT_CREDENTIALS` - Path to JSON file, or JSON contents -* `TALENT_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/talent/v4beta1" - -ENV["TALENT_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/talent/v4beta1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-talent-v4beta1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec b/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec index dd33989b68fe..9073d25b0aa2 100644 --- a/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec +++ b/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb index 26069aa97582..326d5a63ecf0 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb @@ -30,6 +30,9 @@ module CompanyService # A service that handles company management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -109,6 +112,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @company_service_stub.universe_domain + end + ## # Create a new CompanyService client object. # @@ -142,8 +154,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -154,8 +167,10 @@ def initialize @company_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4beta1::CompanyService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -677,9 +692,9 @@ def list_companies request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -725,13 +740,20 @@ def list_companies request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -746,6 +768,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb index f21e6281d9dc..7d33e8d17d11 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service that handles company management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -111,6 +114,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @company_service_stub.universe_domain + end + ## # Create a new CompanyService REST client object. # @@ -138,8 +150,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -149,7 +162,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -632,9 +650,9 @@ def list_companies request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -671,13 +689,20 @@ def list_companies request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -689,6 +714,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb index 140386b810ae..aefa9ed37827 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_company REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb index 29b1bd8e9fa9..e5e24f483b6e 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb @@ -30,6 +30,9 @@ module Completion # A service handles auto completion. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -95,6 +98,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_stub.universe_domain + end + ## # Create a new Completion client object. # @@ -128,8 +140,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -140,8 +153,10 @@ def initialize @completion_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4beta1::Completion::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -302,9 +317,9 @@ def complete_query request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -350,13 +365,20 @@ def complete_query request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -371,6 +393,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb index db4df5eb4076..e85ed3d3ff0a 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service handles auto completion. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -97,6 +100,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_stub.universe_domain + end + ## # Create a new Completion REST client object. # @@ -124,8 +136,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -135,7 +148,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -285,9 +303,9 @@ def complete_query request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -324,13 +342,20 @@ def complete_query request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -342,6 +367,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb index 7d4b30c7bdc4..1072c8c9eb02 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the complete_query REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb index 4ff1b75445af..4c7ff01de522 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb @@ -30,6 +30,9 @@ module EventService # A service handles client event report. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -92,6 +95,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @event_service_stub.universe_domain + end + ## # Create a new EventService client object. # @@ -125,8 +137,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -137,8 +150,10 @@ def initialize @event_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4beta1::EventService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -275,9 +290,9 @@ def create_client_event request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -323,13 +338,20 @@ def create_client_event request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -344,6 +366,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb index 20f5fbc6865d..60517290c851 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service handles client event report. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -94,6 +97,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @event_service_stub.universe_domain + end + ## # Create a new EventService REST client object. # @@ -121,8 +133,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -132,7 +145,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -258,9 +276,9 @@ def create_client_event request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -297,13 +315,20 @@ def create_client_event request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -315,6 +340,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb index bc4ae2a28479..457289cc2b4b 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_client_event REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb index 2261cd4ae03c..085311713cc1 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb @@ -30,6 +30,9 @@ module JobService # A service handles job management, including job CRUD, enumeration and search. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -119,6 +122,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_service_stub.universe_domain + end + ## # Create a new JobService client object. # @@ -152,8 +164,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -166,12 +179,15 @@ def initialize 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, + 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 @@ -1790,9 +1806,9 @@ def search_jobs_for_alert request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -1838,13 +1854,20 @@ def search_jobs_for_alert request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -1859,6 +1882,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb index d5e69d597dd7..6712cc94aa6e 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb @@ -26,6 +26,9 @@ module V4beta1 module JobService # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -613,9 +627,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -661,13 +675,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -682,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb index 0b23759190b3..b5ff0401fd6f 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service handles job management, including job CRUD, enumeration and search. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -121,6 +124,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_service_stub.universe_domain + end + ## # Create a new JobService REST client object. # @@ -148,8 +160,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -163,9 +176,15 @@ def initialize 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, credentials: credentials + @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 + ) end ## @@ -1710,9 +1729,9 @@ def search_jobs_for_alert request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -1749,13 +1768,20 @@ def search_jobs_for_alert request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -1767,6 +1793,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb index fe0ae37c655b..7127f0441f24 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb @@ -26,6 +26,9 @@ module JobService module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -84,8 +96,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -478,9 +492,9 @@ def cancel_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -517,13 +531,20 @@ def cancel_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -535,6 +556,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -617,12 +639,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb index 4da883580525..73dc55a476fa 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_job REST call # diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb index 0837c3b83713..328e7ff313b3 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb @@ -30,6 +30,9 @@ module TenantService # A service that handles tenant management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -109,6 +112,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @tenant_service_stub.universe_domain + end + ## # Create a new TenantService client object. # @@ -142,8 +154,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -154,8 +167,10 @@ def initialize @tenant_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Talent::V4beta1::TenantService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -656,9 +671,9 @@ def list_tenants request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -704,13 +719,20 @@ def list_tenants request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -725,6 +747,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb index 0b559b7cfeec..00a6371bb7a5 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # A service that handles tenant management, including CRUD and enumeration. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -111,6 +114,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @tenant_service_stub.universe_domain + end + ## # Create a new TenantService REST client object. # @@ -138,8 +150,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -149,7 +162,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -611,9 +629,9 @@ def list_tenants request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"jobs.googleapis.com"`. - # @return [::String] + # 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 @@ -650,13 +668,20 @@ def list_tenants request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "jobs.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -668,6 +693,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb index 6316825dbaf8..627bec3d8d8f 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_tenant REST call # diff --git a/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb b/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb index 8ca37c228163..18e46b0fe88d 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb @@ -895,6 +895,7 @@ module PostingRegion # 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 diff --git a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb index ccaf6de34a72..462b8a084e3a 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb @@ -83,6 +83,7 @@ module V4beta1 # @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 diff --git a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb index 67b1befa0c06..3ba5f41529e1 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb @@ -209,6 +209,7 @@ module V4beta1 # 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. # diff --git a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb index cfebeb1a88ee..ccd52f1dd5ae 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb @@ -222,6 +222,7 @@ class ListJobsResponse # # 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 diff --git a/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb index e1f748ca3115..9ed263a1fcaa 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::CompanyService::Client#create_company. # def create_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb index 0c6c0bd158a4..89355ca16363 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::CompanyService::Client#delete_company. # def delete_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb index d32489d404dc..60fa869521ac 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::CompanyService::Client#get_company. # def get_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb b/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb index dc610462a6c1..e0d7f236263f 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::CompanyService::Client#list_companies. # def list_companies # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb index b845a1b3dbb6..8375da2bf24b 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::CompanyService::Client#update_company. # def update_company # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb b/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb index 107b4aa98bb9..3ce89a6dbbc6 100755 --- a/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb +++ b/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::Completion::Client#complete_query. # def complete_query # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb b/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb index a2f2236791fc..be8c118ff0fb 100755 --- a/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb +++ b/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb index 55e15ce6766f..116caf2cf6e8 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb index 33e15aed1717..f60fa81ad16d 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb index ba0f488a0296..adce61946b6e 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb index c2ff6863171f..e2e0c57a47f5 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::JobService::Client#create_job. # def create_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb index 15385e40a282..02d21ed089f2 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::JobService::Client#delete_job. # def delete_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb index 5937e4bbf358..7057493e8a6b 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::JobService::Client#get_job. # def get_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb index db80ce4c0031..efb25ae837da 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs. # def list_jobs # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb index bbb38a27ac2a..1bd16d70b8f0 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs. # def search_jobs # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb index a0bcc13daf61..36a90ae512a8 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# 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. diff --git a/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb index 4f7293a90d43..36ef6a6f8935 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::JobService::Client#update_job. # def update_job # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json b/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json index 857e16da2b93..e22c3aa7c62e 100644 --- a/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json +++ b/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -694,7 +694,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -734,7 +734,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -774,7 +774,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -814,7 +814,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -854,7 +854,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb index 6b9b10ead2c1..3e98b46b16ff 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::TenantService::Client#create_tenant. # def create_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb index fc5714c4f7bc..cae6f3ed1367 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::TenantService::Client#delete_tenant. # def delete_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb index 9ffacf6fa663..21eafdeb17e0 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::TenantService::Client#get_tenant. # def get_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb index 7a85e718f00b..8b3b2481d810 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::TenantService::Client#list_tenants. # def list_tenants # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb index 8b37bfa0c8b3..f4ea15361ecd 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Talent::V4beta1::TenantService::Client#update_tenant. # def update_tenant # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/.owlbot-manifest.json b/google-cloud-tasks-v2/.owlbot-manifest.json index b61c71010ab0..81cd80d1deb1 100644 --- a/google-cloud-tasks-v2/.owlbot-manifest.json +++ b/google-cloud-tasks-v2/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-talent/.toys.rb b/google-cloud-tasks-v2/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-talent/.toys.rb rename to google-cloud-tasks-v2/.toys.rb diff --git a/google-cloud-tasks-v2/AUTHENTICATION.md b/google-cloud-tasks-v2/AUTHENTICATION.md index f3071b208131..17282377935b 100644 --- a/google-cloud-tasks-v2/AUTHENTICATION.md +++ b/google-cloud-tasks-v2/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-tasks-v2 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TASKS_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/tasks/v2" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-tasks-v2 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-tasks-v2 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Tasks::V2::CloudTasks::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TASKS_CREDENTIALS` - Path to JSON file, or JSON contents -* `TASKS_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/tasks/v2" - -ENV["TASKS_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/tasks/v2" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-tasks-v2. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec b/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec index 77a571136e1a..388e8e27656b 100644 --- a/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec +++ b/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" gem.add_dependency "grpc-google-iam-v1", "~> 1.1" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb index d58793e766be..32dc59a3cd9e 100644 --- a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb +++ b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb @@ -32,6 +32,9 @@ module CloudTasks # work in their applications. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -148,6 +151,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_tasks_stub.universe_domain + end + ## # Create a new CloudTasks client object. # @@ -181,8 +193,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -195,12 +208,15 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2::CloudTasks::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -1936,9 +1952,9 @@ def run_task request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtasks.googleapis.com"`. - # @return [::String] + # 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 @@ -1984,13 +2000,20 @@ def run_task request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -2005,6 +2028,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb index 9b6cec61a3e0..e8d3a06a8cfd 100644 --- a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb +++ b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb @@ -34,6 +34,9 @@ module Rest # work in their applications. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -150,6 +153,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_tasks_stub.universe_domain + end + ## # Create a new CloudTasks REST client object. # @@ -177,8 +189,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -192,10 +205,16 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain config.bindings_override = @config.bindings_override end - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + @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 + ) end ## @@ -1815,9 +1834,9 @@ def run_task request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtasks.googleapis.com"`. - # @return [::String] + # 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 @@ -1854,13 +1873,20 @@ def run_task request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -1872,6 +1898,7 @@ class Configuration 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 diff --git a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb index 8fcecb7da48b..3a1a6c4785f6 100644 --- a/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb +++ b/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_queues REST call # diff --git a/google-cloud-tasks-v2/proto_docs/google/api/client.rb b/google-cloud-tasks-v2/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-tasks-v2/proto_docs/google/api/client.rb +++ b/google-cloud-tasks-v2/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb index 4b087dbd76e6..ab4be605a621 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue. # def create_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb index f6ff36cf80e1..6b134f370315 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#create_task. # def create_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb index 113d596d6dd1..722ff00f247f 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue. # def delete_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb index 210d3d913977..be1270d602e3 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task. # def delete_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb index 101059f03cc1..da9f5c610396 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb index 7aaf5b25f148..3e217b38e9e1 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue. # def get_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb index d14eed644b24..7c9edfd766a5 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#get_task. # def get_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb index d478a3c51c1d..776435d672ee 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues. # def list_queues # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb index 48c88197515d..d3327096a8ed 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks. # def list_tasks # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb index a900288215da..0703ba0a8ddd 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue. # def pause_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb index f932ab7fba3b..e80bd4d6906c 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue. # def purge_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb index b6990b87a1fa..45d3502e9022 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue. # def resume_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb index 299b8daffc76..b0d75d0686ba 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#run_task. # def run_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb index 2db85f62c12c..377da439a590 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb index d78e0fb44252..725dc6b0c15c 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb index b9dbaa28afa9..f76b11f3a83b 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue. # def update_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json b/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json index 89fae4064827..7d6f527a85d0 100644 --- a/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json +++ b/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-tasks-v2beta2/.owlbot-manifest.json b/google-cloud-tasks-v2beta2/.owlbot-manifest.json index b7658bcd4a65..a797dd62b905 100644 --- a/google-cloud-tasks-v2beta2/.owlbot-manifest.json +++ b/google-cloud-tasks-v2beta2/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-tasks-v2/.toys.rb b/google-cloud-tasks-v2beta2/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-tasks-v2/.toys.rb rename to google-cloud-tasks-v2beta2/.toys.rb diff --git a/google-cloud-tasks-v2beta2/AUTHENTICATION.md b/google-cloud-tasks-v2beta2/AUTHENTICATION.md index 13a73a8313c9..458865effa49 100644 --- a/google-cloud-tasks-v2beta2/AUTHENTICATION.md +++ b/google-cloud-tasks-v2beta2/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-tasks-v2beta2 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TASKS_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/tasks/v2beta2" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-tasks-v2beta2 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-tasks-v2beta2 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Tasks::V2beta2::CloudTasks::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TASKS_CREDENTIALS` - Path to JSON file, or JSON contents -* `TASKS_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/tasks/v2beta2" - -ENV["TASKS_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/tasks/v2beta2" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-tasks-v2beta2. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec b/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec index ac136d57a802..487a46f001a8 100644 --- a/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec +++ b/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" gem.add_dependency "grpc-google-iam-v1", "~> 1.1" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb index a05a13ea0f61..fa739530cb01 100644 --- a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb +++ b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb @@ -32,6 +32,9 @@ module CloudTasks # work in their applications. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -160,6 +163,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_tasks_stub.universe_domain + end + ## # Create a new CloudTasks client object. # @@ -193,8 +205,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -207,12 +220,15 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2beta2::CloudTasks::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -2689,9 +2705,9 @@ def buffer_task request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtasks.googleapis.com"`. - # @return [::String] + # 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 @@ -2737,13 +2753,20 @@ def buffer_task request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -2758,6 +2781,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb index 9aba7b8af25a..95c4a37b6856 100644 --- a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb +++ b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb @@ -34,6 +34,9 @@ module Rest # work in their applications. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -160,6 +163,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_tasks_stub.universe_domain + end + ## # Create a new CloudTasks REST client object. # @@ -187,8 +199,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -202,10 +215,16 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain config.bindings_override = @config.bindings_override end - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + @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 + ) end ## @@ -2443,9 +2462,9 @@ def buffer_task request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtasks.googleapis.com"`. - # @return [::String] + # 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 @@ -2482,13 +2501,20 @@ def buffer_task request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -2500,6 +2526,7 @@ class Configuration 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 diff --git a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb index 27a57dceed78..bbf0f4ab301f 100644 --- a/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb +++ b/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_queues REST call # diff --git a/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb b/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb +++ b/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb index b174afadfeea..03941ad0ac37 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task. # def acknowledge_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb index 9b48ed22d891..524404a06b9b 100644 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb @@ -22,9 +22,14 @@ ## # Snippet for the buffer_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#buffer_task. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task. # def buffer_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb index 6c97746834c7..e944830fa583 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease. # def cancel_lease # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb index 7b2a8cfed42b..7419562d90a5 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue. # def create_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb index 8b07fbec7683..af5773c9e3ca 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task. # def create_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb index 8ecd4fe7b6f8..0d01cbbdcca0 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue. # def delete_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb index 64f0dfade633..69c2091dd3d1 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task. # def delete_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb index 9b355a71d346..33e1073e8d4a 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb index 40f99e791c8d..5f58a629857f 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue. # def get_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb index 1448b5ed814c..270ded734baa 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task. # def get_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb index 283f0fce983b..86264d22f32c 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks. # def lease_tasks # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb index 7569528212ea..1614a8a91097 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues. # def list_queues # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb index b59019386d78..d050d839f65a 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks. # def list_tasks # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb index cabc64f03a57..343ced5622af 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue. # def pause_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb index e4744691a1ff..ac5b2a4e4a90 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue. # def purge_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb index f84b2bec93c3..4e6f73f31ba5 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease. # def renew_lease # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb index b53029e23c17..77d34d80dded 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue. # def resume_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb index 105b1eb05c51..c898ec64975f 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task. # def run_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb index c2f9aac4412c..95346efa1aaa 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb index dc4f91f58f32..a0fd1602dde7 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb index 94ab83e9107d..ed8eb9227efb 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue. # def update_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb index 686ef89dd453..07f482e72358 100644 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json b/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json index 6e3cbe8ed501..f4e28350aa4c 100644 --- a/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json +++ b/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -694,7 +694,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -734,7 +734,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -774,7 +774,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -814,7 +814,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -854,7 +854,7 @@ { "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_BufferTask_sync", "title": "Snippet for the buffer_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task. It may require modification in order to execute successfully.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task.", "file": "cloud_tasks/buffer_task.rb", "language": "RUBY", "client_method": { @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-tasks-v2beta3/.owlbot-manifest.json b/google-cloud-tasks-v2beta3/.owlbot-manifest.json index 2b1547a6d9a1..5a073a2a5d0a 100644 --- a/google-cloud-tasks-v2beta3/.owlbot-manifest.json +++ b/google-cloud-tasks-v2beta3/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb b/google-cloud-tasks-v2beta3/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb rename to google-cloud-tasks-v2beta3/.toys.rb diff --git a/google-cloud-tasks-v2beta3/AUTHENTICATION.md b/google-cloud-tasks-v2beta3/AUTHENTICATION.md index 4b1755de4c20..8a26642ba1e1 100644 --- a/google-cloud-tasks-v2beta3/AUTHENTICATION.md +++ b/google-cloud-tasks-v2beta3/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-tasks-v2beta3 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TASKS_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/tasks/v2beta3" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-tasks-v2beta3 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-tasks-v2beta3 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Tasks::V2beta3::CloudTasks::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TASKS_CREDENTIALS` - Path to JSON file, or JSON contents -* `TASKS_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/tasks/v2beta3" - -ENV["TASKS_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/tasks/v2beta3" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-tasks-v2beta3. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec b/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec index b74540832f98..43d3204a9f26 100644 --- a/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec +++ b/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" gem.add_dependency "grpc-google-iam-v1", "~> 1.1" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb index 861abf094186..a3dbabdf4473 100644 --- a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb +++ b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb @@ -32,6 +32,9 @@ module CloudTasks # work in their applications. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -150,6 +153,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_tasks_stub.universe_domain + end + ## # Create a new CloudTasks client object. # @@ -183,8 +195,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -197,12 +210,15 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @cloud_tasks_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Tasks::V2beta3::CloudTasks::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -2065,9 +2081,9 @@ def buffer_task request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtasks.googleapis.com"`. - # @return [::String] + # 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 @@ -2113,13 +2129,20 @@ def buffer_task request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -2134,6 +2157,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb index 4017a9683c8e..7706e25f6e98 100644 --- a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb +++ b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb @@ -34,6 +34,9 @@ module Rest # work in their applications. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -152,6 +155,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cloud_tasks_stub.universe_domain + end + ## # Create a new CloudTasks REST client object. # @@ -179,8 +191,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -194,10 +207,16 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain config.bindings_override = @config.bindings_override end - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + @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 + ) end ## @@ -1934,9 +1953,9 @@ def buffer_task request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtasks.googleapis.com"`. - # @return [::String] + # 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 @@ -1973,13 +1992,20 @@ def buffer_task request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -1991,6 +2017,7 @@ class Configuration 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 diff --git a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb index 0956c3a4a4ae..b0a80386cea0 100644 --- a/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb +++ b/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_queues REST call # diff --git a/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb b/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb +++ b/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb index 6286a1412914..a3735f441dc1 100644 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb @@ -22,9 +22,14 @@ ## # Snippet for the buffer_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#buffer_task. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task. # def buffer_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb index ca654c5d35a8..e89294f78270 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue. # def create_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb index 80773e88b91e..b9206fbec184 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task. # def create_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb index 2b54421da646..09b151773c7f 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue. # def delete_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb index e20fa79cfdb8..9ebcb7c264f2 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task. # def delete_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb index 0111e5aa0827..883f67b19768 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb index 004ab14a8f27..b58696531da4 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue. # def get_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb index c272588e6a9d..12d93ef1af78 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task. # def get_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb index 8ed1e9d9bc39..b353b3220da7 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues. # def list_queues # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb index 4e95871d9090..0830c2a1437e 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks. # def list_tasks # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb index 8556ee9eb85b..d9b3887627be 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue. # def pause_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb index d2d396b99c82..ce87127a41c0 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue. # def purge_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb index 867075c4f850..8bfeb9cfbbb5 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue. # def resume_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb index fa1fa08ac910..4b7d74af042a 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task. # def run_task # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb index 0e0241322fb5..ca8992d77083 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb index 23de447fa347..6d03a7eb5883 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb index c273a43d1df2..e024d9fbda54 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue. # def update_queue # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json b/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json index 5e71c4a1f24e..4a2a82758d05 100644 --- a/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json +++ b/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync", "title": "Snippet for the buffer_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task. It may require modification in order to execute successfully.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task.", "file": "cloud_tasks/buffer_task.rb", "language": "RUBY", "client_method": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-telco_automation-v1/.owlbot-manifest.json b/google-cloud-telco_automation-v1/.owlbot-manifest.json index 6a6801291305..8d9e1e05dc8e 100644 --- a/google-cloud-telco_automation-v1/.owlbot-manifest.json +++ b/google-cloud-telco_automation-v1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb b/google-cloud-telco_automation-v1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb rename to google-cloud-telco_automation-v1/.toys.rb diff --git a/google-cloud-telco_automation-v1/AUTHENTICATION.md b/google-cloud-telco_automation-v1/AUTHENTICATION.md index 3e33b8d3f814..15c5b59bafcf 100644 --- a/google-cloud-telco_automation-v1/AUTHENTICATION.md +++ b/google-cloud-telco_automation-v1/AUTHENTICATION.md @@ -1,149 +1,122 @@ # Authentication -In general, the google-cloud-telco_automation-v1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/telco_automation/v1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-telco_automation-v1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-telco_automation-v1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/telco_automation/v1" - -ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/telco_automation/v1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-telco_automation-v1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec b/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec index 761d98a0503f..8913187de737 100644 --- a/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec +++ b/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.3" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb index f13157f3ea0f..aa58e1905b13 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb @@ -35,6 +35,9 @@ module TelcoAutomation # functions. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -95,6 +98,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @telco_automation_stub.universe_domain + end + ## # Create a new TelcoAutomation client object. # @@ -128,8 +140,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -142,18 +155,22 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @location_client = Google::Cloud::Location::Locations::Client.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, + 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 @@ -3563,9 +3580,9 @@ def apply_hydrated_deployment request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"telcoautomation.googleapis.com"`. - # @return [::String] + # 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 @@ -3611,13 +3628,20 @@ def apply_hydrated_deployment request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -3632,6 +3656,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb index c6d368691dda..e513423c3399 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb @@ -26,6 +26,9 @@ module V1 module TelcoAutomation # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -613,9 +627,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"telcoautomation.googleapis.com"`. - # @return [::String] + # 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 @@ -661,13 +675,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -682,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb index 0c8d52b8c6ed..16e145cd97dc 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb @@ -37,6 +37,9 @@ module Rest # functions. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -97,6 +100,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @telco_automation_stub.universe_domain + end + ## # Create a new TelcoAutomation REST client object. # @@ -124,8 +136,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -139,16 +152,23 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain config.bindings_override = @config.bindings_override end - @telco_automation_stub = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + @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 + ) end ## @@ -3300,9 +3320,9 @@ def apply_hydrated_deployment request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"telcoautomation.googleapis.com"`. - # @return [::String] + # 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 @@ -3339,13 +3359,20 @@ def apply_hydrated_deployment request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -3357,6 +3384,7 @@ class Configuration 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 diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb index ee79396c256f..381ece3dc1ff 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb @@ -26,6 +26,9 @@ module TelcoAutomation module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -84,8 +96,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -478,9 +492,9 @@ def cancel_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"telcoautomation.googleapis.com"`. - # @return [::String] + # 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 @@ -517,13 +531,20 @@ def cancel_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -535,6 +556,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -617,12 +639,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb index 82575ad517b6..aef5b26d1d07 100644 --- a/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb +++ b/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_orchestration_clusters REST call # diff --git a/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb b/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb index c38077287bbc..53fb4bc2d7da 100644 --- a/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb +++ b/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json b/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json index 8075e0af49c1..ab6edef8ffb4 100644 --- a/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json +++ b/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -694,7 +694,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -734,7 +734,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -774,7 +774,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -814,7 +814,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -854,7 +854,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -894,7 +894,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -934,7 +934,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -974,7 +974,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1014,7 +1014,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1054,7 +1054,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -1094,7 +1094,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -1134,7 +1134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1174,7 +1174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1214,7 +1214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1254,7 +1254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1294,7 +1294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1334,7 +1334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -1374,7 +1374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -1414,7 +1414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb index 341353220cc6..79c14443188a 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def apply_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb index df9c79353fb1..ada84baaad0b 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def apply_hydrated_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb index e234d4331cb9..32fa845604ec 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def approve_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb index 4c2cfe2e6f33..f06ca76893e1 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def compute_deployment_status # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb index 0f1a655c7952..c29c78ccb10e 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb index 3c00fc3dc3cb..289ff36485f9 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb index 4fe844de25df..fec9e907d0df 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_edge_slm # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb index 9fca9abe234c..f057c48baeac 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_orchestration_cluster # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb index 14bbcb205d29..c39d1ee60b55 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb index 78aebbe06fda..fbd2705f4f5d 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_edge_slm # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb index bb0508a957b3..82c837708c5c 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_orchestration_cluster # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb index c47aff77cd50..96b686a223c5 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def discard_blueprint_changes # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb index b978973ea7f3..1093f4ea5820 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def discard_deployment_changes # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb index 7ff2bf2b6049..151e5fc56dd5 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint. # def get_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb index f00a4e32541b..c990b27bfa88 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment. # def get_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb index d4e97f59b04d..145d97453441 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# 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. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb index 08f59f08fe18..81c2132e34d8 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_hydrated_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb index 230361e32011..179cec5348c8 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_orchestration_cluster # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb index 39d56ff2139d..ee4ab3bb2965 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_public_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb index fd72bab1f7ec..13d182f65132 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_blueprint_revisions # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb index 514e841b3e65..f9e56669ac7c 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_blueprints # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb index 03b9a5e97d0c..f763758c6779 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_deployment_revisions # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb index 043199760e0a..ef9b78af9687 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_deployments # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb index a971590f9321..0309563ede0a 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# 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. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb index c6c7d2bdeb6f..f1cbcb9c6e06 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_hydrated_deployments # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb index 52478dcab6ff..49a356040256 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_orchestration_clusters # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb index 6b67fc0b9741..ecc522198249 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_public_blueprints # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb index a2437894d5b7..dfd75d78c8a4 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def propose_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb index 863e2a37b235..4206b332b04f 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def reject_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb index 225e1df3b19c..19718ae1a50f 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def remove_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb index 536b9287de6d..e32479000c4e 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def rollback_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb index 89e5a36cb4e6..5d1c82557913 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def search_blueprint_revisions # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb index b9f44c33d909..869e24da2bba 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def search_deployment_revisions # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb index 63170be49047..3a59b7978996 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def update_blueprint # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb index 26d5e10c0df5..e70d0dadbeb8 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def update_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb b/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb index 2ab19398488f..6a1ddf862e30 100644 --- a/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb +++ b/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def update_hydrated_deployment # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-text_to_speech-v1/.owlbot-manifest.json b/google-cloud-text_to_speech-v1/.owlbot-manifest.json index fe1a54fc5ea3..21f4261125be 100644 --- a/google-cloud-text_to_speech-v1/.owlbot-manifest.json +++ b/google-cloud-text_to_speech-v1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-tasks/.toys.rb b/google-cloud-text_to_speech-v1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-tasks/.toys.rb rename to google-cloud-text_to_speech-v1/.toys.rb diff --git a/google-cloud-text_to_speech-v1/AUTHENTICATION.md b/google-cloud-text_to_speech-v1/AUTHENTICATION.md index df4fba635a58..9eb74f158a54 100644 --- a/google-cloud-text_to_speech-v1/AUTHENTICATION.md +++ b/google-cloud-text_to_speech-v1/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-text_to_speech-v1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TEXTTOSPEECH_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/text_to_speech/v1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-text_to_speech-v1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-text_to_speech-v1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::TextToSpeech::V1::TextToSpeech::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TEXTTOSPEECH_CREDENTIALS` - Path to JSON file, or JSON contents -* `TEXTTOSPEECH_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/text_to_speech/v1" - -ENV["TEXTTOSPEECH_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/text_to_speech/v1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-text_to_speech-v1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec b/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec index 7649ffd1e0f6..e0eea98306cf 100644 --- a/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec +++ b/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb index 1b3a7633674b..e3b282698d26 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb @@ -30,6 +30,9 @@ module TextToSpeech # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -95,6 +98,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @text_to_speech_stub.universe_domain + end + ## # Create a new TextToSpeech client object. # @@ -128,8 +140,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -140,8 +153,10 @@ def initialize @text_to_speech_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -346,9 +361,9 @@ def synthesize_speech request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -394,13 +409,20 @@ def synthesize_speech request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -415,6 +437,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb index 2d692f9ce9e6..7b2100d7d1a9 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb @@ -32,6 +32,9 @@ module Rest # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -97,6 +100,15 @@ def configure @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. # @@ -124,8 +136,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -135,7 +148,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -338,9 +356,9 @@ def synthesize_speech request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -377,13 +395,20 @@ def synthesize_speech request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -395,6 +420,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb index 1d6d18318602..0a9794e343ed 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_voices REST call # diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb index 2c4dffb492f6..1fc0b51e89e6 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb @@ -30,6 +30,9 @@ module TextToSpeechLongAudioSynthesize # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -92,6 +95,15 @@ def configure @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. # @@ -125,8 +137,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -139,12 +152,15 @@ def initialize 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, + 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 @@ -295,9 +311,9 @@ def synthesize_long_audio request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -343,13 +359,20 @@ def synthesize_long_audio request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -364,6 +387,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb index 1850d949ea64..575addcf6f28 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb @@ -26,6 +26,9 @@ module V1 module TextToSpeechLongAudioSynthesize # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -613,9 +627,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -661,13 +675,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -682,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb index a078d2cd2306..a406ef592106 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb @@ -32,6 +32,9 @@ module Rest # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -94,6 +97,15 @@ def configure @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. # @@ -121,8 +133,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -136,9 +149,15 @@ def initialize 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, credentials: credentials + @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 + ) end ## @@ -278,9 +297,9 @@ def synthesize_long_audio request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -317,13 +336,20 @@ def synthesize_long_audio request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -335,6 +361,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb index 0c76ac3a5ef5..288a6473b3c0 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb @@ -26,6 +26,9 @@ module TextToSpeechLongAudioSynthesize module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -84,8 +96,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -478,9 +492,9 @@ def cancel_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -517,13 +531,20 @@ def cancel_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -535,6 +556,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -617,12 +639,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb index 9c58e3832065..fcf77a7858c2 100644 --- a/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the synthesize_long_audio REST call # diff --git a/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb b/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb +++ b/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb b/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb index 9037b9f91328..7e69f954f47c 100644 --- a/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb +++ b/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb @@ -187,6 +187,7 @@ class AudioConfig # @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 diff --git a/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb b/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb index 4d87ddc77c39..85353c3aa042 100644 --- a/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb +++ b/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb @@ -58,6 +58,7 @@ class SynthesizeLongAudioResponse # @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 diff --git a/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json b/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json index ce993c63e0e0..406ba8fddbbf 100644 --- a/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json +++ b/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] diff --git a/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb b/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb index 0526828e63a2..25cbc2170195 100755 --- a/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb +++ b/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#list_voices. # def list_voices # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb b/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb index 66811843d07d..1b8600ef3367 100755 --- a/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb +++ b/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech. # def synthesize_speech # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb b/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb index c93f160f4f04..37dfc32e3077 100644 --- a/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb +++ b/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def synthesize_long_audio # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json b/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json index 9ed552ee8761..e4d363e464bd 100644 --- a/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json +++ b/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb b/google-cloud-text_to_speech-v1beta1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb rename to google-cloud-text_to_speech-v1beta1/.toys.rb diff --git a/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md b/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md index 001642a0d89a..b8cf76c40475 100644 --- a/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md +++ b/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-text_to_speech-v1beta1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TEXTTOSPEECH_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/text_to_speech/v1beta1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-text_to_speech-v1beta1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-text_to_speech-v1beta1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TEXTTOSPEECH_CREDENTIALS` - Path to JSON file, or JSON contents -* `TEXTTOSPEECH_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/text_to_speech/v1beta1" - -ENV["TEXTTOSPEECH_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/text_to_speech/v1beta1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-text_to_speech-v1beta1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec b/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec index 9fd11c4ba3d8..fc8dc5fa7fe9 100644 --- a/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec +++ b/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb index 590d03779380..957a8d0ae3a8 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb @@ -30,6 +30,9 @@ module TextToSpeech # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -95,6 +98,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @text_to_speech_stub.universe_domain + end + ## # Create a new TextToSpeech client object. # @@ -128,8 +140,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -140,8 +153,10 @@ def initialize @text_to_speech_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -348,9 +363,9 @@ def synthesize_speech request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -396,13 +411,20 @@ def synthesize_speech request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -417,6 +439,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb index d7d403d8dfb7..753ba03957b3 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb @@ -32,6 +32,9 @@ module Rest # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -97,6 +100,15 @@ def configure @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. # @@ -124,8 +136,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -135,7 +148,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -340,9 +358,9 @@ def synthesize_speech request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -379,13 +397,20 @@ def synthesize_speech request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -397,6 +422,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb index 6e791907830a..21da587d40e1 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_voices REST call # diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb index 933a250f0331..782cdf713f5d 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb @@ -30,6 +30,9 @@ module TextToSpeechLongAudioSynthesize # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -92,6 +95,15 @@ def configure @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. # @@ -125,8 +137,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -139,12 +152,15 @@ def initialize 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, + 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 @@ -295,9 +311,9 @@ def synthesize_long_audio request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -343,13 +359,20 @@ def synthesize_long_audio request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -364,6 +387,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb index 51816f03e530..b7606e84939d 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb @@ -26,6 +26,9 @@ module V1beta1 module TextToSpeechLongAudioSynthesize # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -613,9 +627,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -661,13 +675,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -682,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb index 9bf229fb4d8f..1cc5696f367c 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb @@ -32,6 +32,9 @@ module Rest # Service that implements Google Cloud Text-to-Speech API. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -94,6 +97,15 @@ def configure @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. # @@ -121,8 +133,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -136,9 +149,15 @@ def initialize 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, credentials: credentials + @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 + ) end ## @@ -278,9 +297,9 @@ def synthesize_long_audio request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -317,13 +336,20 @@ def synthesize_long_audio request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -335,6 +361,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb index 9a7f5b775b19..7ef090018393 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb @@ -26,6 +26,9 @@ module TextToSpeechLongAudioSynthesize module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -84,8 +96,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -478,9 +492,9 @@ def cancel_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"texttospeech.googleapis.com"`. - # @return [::String] + # 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 @@ -517,13 +531,20 @@ def cancel_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -535,6 +556,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -617,12 +639,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb index 7f2185b06d71..a492162ab61e 100644 --- a/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb +++ b/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the synthesize_long_audio REST call # diff --git a/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb b/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb b/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb index eb8d85d5916b..0e563264c128 100644 --- a/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb +++ b/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb @@ -199,6 +199,7 @@ class AudioConfig # @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 diff --git a/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb b/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb index 9ba88e033cd7..158186d6b86f 100644 --- a/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb +++ b/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb @@ -58,6 +58,7 @@ class SynthesizeLongAudioResponse # @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 diff --git a/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json index d546b8b7dcf3..ecdd96f05db8 100644 --- a/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ b/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] diff --git a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb index fe53f17d9e57..beb6569fc540 100755 --- a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb +++ b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices. # def list_voices # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb index 35e1d53c7b01..1d53311ff914 100755 --- a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb +++ b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def synthesize_speech # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb index 358aff4ee359..f980c59239b0 100644 --- a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb +++ b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def synthesize_long_audio # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/.owlbot-manifest.json b/google-cloud-tpu-v1/.owlbot-manifest.json index 66790713cf45..bb3374a10707 100644 --- a/google-cloud-tpu-v1/.owlbot-manifest.json +++ b/google-cloud-tpu-v1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-telco_automation/.toys.rb b/google-cloud-tpu-v1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-telco_automation/.toys.rb rename to google-cloud-tpu-v1/.toys.rb diff --git a/google-cloud-tpu-v1/AUTHENTICATION.md b/google-cloud-tpu-v1/AUTHENTICATION.md index 9afc29d187a5..dcd3772bc00e 100644 --- a/google-cloud-tpu-v1/AUTHENTICATION.md +++ b/google-cloud-tpu-v1/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-tpu-v1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export CLOUD_TPU_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/tpu/v1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Tpu::V1::Tpu::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-tpu-v1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-tpu-v1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Tpu::V1::Tpu::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `CLOUD_TPU_CREDENTIALS` - Path to JSON file, or JSON contents -* `CLOUD_TPU_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/tpu/v1" - -ENV["CLOUD_TPU_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Tpu::V1::Tpu::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Tpu::V1::Tpu::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/tpu/v1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-tpu-v1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Tpu::V1::Tpu::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec b/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec index 937f1dd36fef..73831c0c6e39 100644 --- a/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec +++ b/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.3" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb b/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb index 8e002593c960..8298c67e13b1 100644 --- a/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb +++ b/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb @@ -33,6 +33,9 @@ module Tpu # TPU API v1 # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "tpu.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -95,6 +98,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @tpu_stub.universe_domain + end + ## # Create a new Tpu client object. # @@ -128,8 +140,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -142,18 +155,22 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @location_client = Google::Cloud::Location::Locations::Client.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, + 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 @@ -1222,9 +1239,9 @@ def get_accelerator_type request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"tpu.googleapis.com"`. - # @return [::String] + # 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 @@ -1270,13 +1287,20 @@ def get_accelerator_type request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "tpu.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -1291,6 +1315,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb b/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb index caa5873693d1..2558f1eea8ef 100644 --- a/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb +++ b/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb @@ -26,6 +26,9 @@ module V1 module Tpu # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "tpu.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -613,9 +627,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"tpu.googleapis.com"`. - # @return [::String] + # 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 @@ -661,13 +675,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "tpu.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -682,6 +703,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-tpu-v1/proto_docs/google/api/client.rb b/google-cloud-tpu-v1/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-tpu-v1/proto_docs/google/api/client.rb +++ b/google-cloud-tpu-v1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb b/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb index 49bd830e5b65..827c35f40372 100644 --- a/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb +++ b/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb @@ -56,11 +56,13 @@ class NetworkEndpoint # @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. diff --git a/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json b/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json index bc235f34bf07..62be9f4a7dc2 100644 --- a/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json +++ b/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-tpu-v1/snippets/tpu/create_node.rb b/google-cloud-tpu-v1/snippets/tpu/create_node.rb index c5a6a8ccbc95..c5cea1385b04 100755 --- a/google-cloud-tpu-v1/snippets/tpu/create_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/create_node.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification -# in order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#create_node. # def create_node # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/snippets/tpu/delete_node.rb b/google-cloud-tpu-v1/snippets/tpu/delete_node.rb index 0f6c17d6e8be..dc90d4ccfdff 100755 --- a/google-cloud-tpu-v1/snippets/tpu/delete_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/delete_node.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification -# in order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#delete_node. # def delete_node # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb b/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb index bdddcf9c6242..569434b9f54f 100755 --- a/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb +++ b/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# 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. diff --git a/google-cloud-tpu-v1/snippets/tpu/get_node.rb b/google-cloud-tpu-v1/snippets/tpu/get_node.rb index 5c9507a9ee6e..6c3a3de67a73 100755 --- a/google-cloud-tpu-v1/snippets/tpu/get_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/get_node.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification in -# order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#get_node. # def get_node # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb b/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb index 579de50272bc..e2846a9353a9 100755 --- a/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb +++ b/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# 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. diff --git a/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb b/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb index 005fd6bb1cca..5ae93dce3a85 100755 --- a/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb +++ b/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# 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. diff --git a/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb b/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb index 39629169451d..77080aac8b3d 100755 --- a/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb +++ b/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification in -# order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#list_nodes. # def list_nodes # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb b/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb index d82cc114eca3..450c31093d5e 100755 --- a/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb +++ b/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# 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. diff --git a/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb b/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb index b35e34d80b11..51751bb3673c 100755 --- a/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification -# in order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#reimage_node. # def reimage_node # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/snippets/tpu/start_node.rb b/google-cloud-tpu-v1/snippets/tpu/start_node.rb index c323330039e5..4123d3ec4d63 100755 --- a/google-cloud-tpu-v1/snippets/tpu/start_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/start_node.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification in -# order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#start_node. # def start_node # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-tpu-v1/snippets/tpu/stop_node.rb b/google-cloud-tpu-v1/snippets/tpu/stop_node.rb index 4fcfa059614f..f737e5cf763d 100755 --- a/google-cloud-tpu-v1/snippets/tpu/stop_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/stop_node.rb @@ -22,9 +22,14 @@ ## # 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. It may require modification in -# order to execute successfully. +# Google::Cloud::Tpu::V1::Tpu::Client#stop_node. # def stop_node # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-trace-v1/.owlbot-manifest.json b/google-cloud-trace-v1/.owlbot-manifest.json index 0ff772fd225a..f57a75fe03b6 100644 --- a/google-cloud-trace-v1/.owlbot-manifest.json +++ b/google-cloud-trace-v1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb b/google-cloud-trace-v1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb rename to google-cloud-trace-v1/.toys.rb diff --git a/google-cloud-trace-v1/AUTHENTICATION.md b/google-cloud-trace-v1/AUTHENTICATION.md index 130732376534..ce2edb9aa12f 100644 --- a/google-cloud-trace-v1/AUTHENTICATION.md +++ b/google-cloud-trace-v1/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-trace-v1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TRACE_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/trace/v1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Trace::V1::TraceService::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-trace-v1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-trace-v1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Trace::V1::TraceService::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TRACE_CREDENTIALS` - Path to JSON file, or JSON contents -* `TRACE_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/trace/v1" - -ENV["TRACE_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Trace::V1::TraceService::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Trace::V1::TraceService::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/trace/v1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-trace-v1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Trace::V1::TraceService::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-trace-v1/google-cloud-trace-v1.gemspec b/google-cloud-trace-v1/google-cloud-trace-v1.gemspec index c0aad2a07355..1f336f31aafc 100644 --- a/google-cloud-trace-v1/google-cloud-trace-v1.gemspec +++ b/google-cloud-trace-v1/google-cloud-trace-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb index 8697f7a5557a..d5f163bd9975 100644 --- a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb +++ b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb @@ -34,6 +34,9 @@ module TraceService # may span multiple services. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + # @private attr_reader :trace_service_stub @@ -107,6 +110,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @trace_service_stub.universe_domain + end + ## # Create a new TraceService client object. # @@ -140,8 +152,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -152,8 +165,10 @@ def initialize @trace_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Trace::V1::TraceService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -524,9 +539,9 @@ def patch_traces request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtrace.googleapis.com"`. - # @return [::String] + # 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 @@ -572,13 +587,20 @@ def patch_traces request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -593,6 +615,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb index 1d9b1e6db0fd..db20303015bc 100644 --- a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb +++ b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb @@ -36,6 +36,9 @@ module Rest # may span multiple services. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + # @private attr_reader :trace_service_stub @@ -109,6 +112,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @trace_service_stub.universe_domain + end + ## # Create a new TraceService REST client object. # @@ -136,8 +148,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -147,7 +160,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -490,9 +508,9 @@ def patch_traces request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtrace.googleapis.com"`. - # @return [::String] + # 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 @@ -529,13 +547,20 @@ def patch_traces request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -547,6 +572,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb index 8408bf6992ae..bb220bbd25ec 100644 --- a/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb +++ b/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the list_traces REST call # diff --git a/google-cloud-trace-v1/proto_docs/google/api/client.rb b/google-cloud-trace-v1/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-trace-v1/proto_docs/google/api/client.rb +++ b/google-cloud-trace-v1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json b/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json index e640c912840a..fd29717eab91 100644 --- a/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json +++ b/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-trace-v1/snippets/trace_service/get_trace.rb b/google-cloud-trace-v1/snippets/trace_service/get_trace.rb index 709ec8257acb..486b393aa553 100755 --- a/google-cloud-trace-v1/snippets/trace_service/get_trace.rb +++ b/google-cloud-trace-v1/snippets/trace_service/get_trace.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Trace::V1::TraceService::Client#get_trace. # def get_trace # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-trace-v1/snippets/trace_service/list_traces.rb b/google-cloud-trace-v1/snippets/trace_service/list_traces.rb index 2b4c32ad330d..0d2f5d701cff 100755 --- a/google-cloud-trace-v1/snippets/trace_service/list_traces.rb +++ b/google-cloud-trace-v1/snippets/trace_service/list_traces.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Trace::V1::TraceService::Client#list_traces. # def list_traces # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb b/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb index c00862a0cd40..79fd9e53275d 100755 --- a/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb +++ b/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Trace::V1::TraceService::Client#patch_traces. # def patch_traces # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-trace-v2/.owlbot-manifest.json b/google-cloud-trace-v2/.owlbot-manifest.json index 44cffa1f84f5..3c06f86ee870 100644 --- a/google-cloud-trace-v2/.owlbot-manifest.json +++ b/google-cloud-trace-v2/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb b/google-cloud-trace-v2/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb rename to google-cloud-trace-v2/.toys.rb diff --git a/google-cloud-trace-v2/AUTHENTICATION.md b/google-cloud-trace-v2/AUTHENTICATION.md index 82055fe3981f..cd2b7cadfb3d 100644 --- a/google-cloud-trace-v2/AUTHENTICATION.md +++ b/google-cloud-trace-v2/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-trace-v2 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TRACE_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/trace/v2" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Trace::V2::TraceService::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-trace-v2 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-trace-v2 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Trace::V2::TraceService::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TRACE_CREDENTIALS` - Path to JSON file, or JSON contents -* `TRACE_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/trace/v2" - -ENV["TRACE_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Trace::V2::TraceService::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Trace::V2::TraceService::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/trace/v2" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-trace-v2. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Trace::V2::TraceService::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-trace-v2/google-cloud-trace-v2.gemspec b/google-cloud-trace-v2/google-cloud-trace-v2.gemspec index cefadc6e3dea..17a85424605a 100644 --- a/google-cloud-trace-v2/google-cloud-trace-v2.gemspec +++ b/google-cloud-trace-v2/google-cloud-trace-v2.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb index bf6bbdc4d385..76da3df03b2b 100644 --- a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb +++ b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb @@ -36,6 +36,9 @@ module TraceService # A single trace can contain spans from multiple services. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -106,6 +109,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @trace_service_stub.universe_domain + end + ## # Create a new TraceService client object. # @@ -139,8 +151,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -151,8 +164,10 @@ def initialize @trace_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Trace::V2::TraceService::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -422,9 +437,9 @@ def create_span request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtrace.googleapis.com"`. - # @return [::String] + # 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 @@ -470,13 +485,20 @@ def create_span request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -491,6 +513,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb index db5e8849a27e..6bc25e901946 100644 --- a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb +++ b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb @@ -38,6 +38,9 @@ module Rest # A single trace can contain spans from multiple services. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -108,6 +111,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @trace_service_stub.universe_domain + end + ## # Create a new TraceService REST client object. # @@ -135,8 +147,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -146,7 +159,12 @@ def initialize @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, credentials: credentials + @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 + ) end # Service calls @@ -398,9 +416,9 @@ def create_span request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudtrace.googleapis.com"`. - # @return [::String] + # 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 @@ -437,13 +455,20 @@ def create_span request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -455,6 +480,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb index e20896e1f33f..694e5ca99416 100644 --- a/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb +++ b/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the batch_write_spans REST call # diff --git a/google-cloud-trace-v2/proto_docs/google/api/client.rb b/google-cloud-trace-v2/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-trace-v2/proto_docs/google/api/client.rb +++ b/google-cloud-trace-v2/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json b/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json index 69218ad4667d..0a42ed8c485d 100644 --- a/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json +++ b/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] diff --git a/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb b/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb index c3e69e0a318f..99158e4bec50 100755 --- a/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb +++ b/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# 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. diff --git a/google-cloud-trace-v2/snippets/trace_service/create_span.rb b/google-cloud-trace-v2/snippets/trace_service/create_span.rb index 1fa25e399969..d2c038565d90 100755 --- a/google-cloud-trace-v2/snippets/trace_service/create_span.rb +++ b/google-cloud-trace-v2/snippets/trace_service/create_span.rb @@ -22,9 +22,14 @@ ## # 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. It may require -# modification in order to execute successfully. +# Google::Cloud::Trace::V2::TraceService::Client#create_span. # def create_span # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/.owlbot-manifest.json b/google-cloud-translate-v3/.owlbot-manifest.json index 42398758b96e..6337e9ca7136 100644 --- a/google-cloud-translate-v3/.owlbot-manifest.json +++ b/google-cloud-translate-v3/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-text_to_speech/.toys.rb b/google-cloud-translate-v3/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-text_to_speech/.toys.rb rename to google-cloud-translate-v3/.toys.rb diff --git a/google-cloud-translate-v3/AUTHENTICATION.md b/google-cloud-translate-v3/AUTHENTICATION.md index 4ed5a7ebd7c7..f67deb161865 100644 --- a/google-cloud-translate-v3/AUTHENTICATION.md +++ b/google-cloud-translate-v3/AUTHENTICATION.md @@ -1,151 +1,122 @@ # Authentication -In general, the google-cloud-translate-v3 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export TRANSLATE_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/translate/v3" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Translate::V3::TranslationService::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-translate-v3 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-translate-v3 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Translate::V3::TranslationService::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `TRANSLATE_CREDENTIALS` - Path to JSON file, or JSON contents -* `TRANSLATE_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/translate/v3" - -ENV["TRANSLATE_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Translate::V3::TranslationService::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Translate::V3::TranslationService::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/translate/v3" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-translate-v3. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Translate::V3::TranslationService::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-translate-v3/google-cloud-translate-v3.gemspec b/google-cloud-translate-v3/google-cloud-translate-v3.gemspec index d28c50221117..24133f499d21 100644 --- a/google-cloud-translate-v3/google-cloud-translate-v3.gemspec +++ b/google-cloud-translate-v3/google-cloud-translate-v3.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb index 51ad18e6c7e1..a0e49514b10a 100644 --- a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb +++ b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb @@ -30,6 +30,9 @@ module TranslationService # Provides natural language translation operations. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -122,6 +125,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @translation_service_stub.universe_domain + end + ## # Create a new TranslationService client object. # @@ -155,8 +167,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -169,12 +182,15 @@ def initialize 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, + 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 @@ -2385,9 +2401,9 @@ def list_adaptive_mt_sentences request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"translate.googleapis.com"`. - # @return [::String] + # 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 @@ -2433,13 +2449,20 @@ def list_adaptive_mt_sentences request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "translate.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -2454,6 +2477,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb index ebb0f00dcfd3..760c6afa9b83 100644 --- a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb +++ b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb @@ -26,6 +26,9 @@ module V3 module TranslationService # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -90,8 +102,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -621,9 +635,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"translate.googleapis.com"`. - # @return [::String] + # 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 @@ -669,13 +683,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "translate.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -690,6 +711,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb index abaae9805e00..66bfb5097da2 100644 --- a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb +++ b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb @@ -32,6 +32,9 @@ module Rest # Provides natural language translation operations. # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -124,6 +127,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @translation_service_stub.universe_domain + end + ## # Create a new TranslationService REST client object. # @@ -151,8 +163,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -166,9 +179,15 @@ def initialize 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, credentials: credentials + @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 + ) end ## @@ -2235,9 +2254,9 @@ def list_adaptive_mt_sentences request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"translate.googleapis.com"`. - # @return [::String] + # 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 @@ -2274,13 +2293,20 @@ def list_adaptive_mt_sentences request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "translate.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -2292,6 +2318,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb index 9bb0915e9256..f620aea2458f 100644 --- a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb +++ b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb @@ -26,6 +26,9 @@ module TranslationService module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -60,6 +63,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -84,8 +96,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -576,9 +590,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"translate.googleapis.com"`. - # @return [::String] + # 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 @@ -615,13 +629,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "translate.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -633,6 +654,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -722,12 +744,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb index 3a834a5cd7e4..7e1616631aa2 100644 --- a/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +++ b/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb @@ -30,16 +30,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the translate_text REST call # diff --git a/google-cloud-translate-v3/proto_docs/google/api/client.rb b/google-cloud-translate-v3/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-translate-v3/proto_docs/google/api/client.rb +++ b/google-cloud-translate-v3/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json b/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json index d09d44523c16..04064440096a 100644 --- a/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json +++ b/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -694,7 +694,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -734,7 +734,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -774,7 +774,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] diff --git a/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb b/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb index 7508afeb484f..1cd1b30dce10 100644 --- a/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb +++ b/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def adaptive_mt_translate # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb b/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb index c1b059c7f171..0f0f0719f5ec 100755 --- a/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb +++ b/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def batch_translate_document # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb b/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb index 347256df4652..537b1cbdd63f 100755 --- a/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb +++ b/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def batch_translate_text # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb b/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb index 1c4837673403..aa2dfe4d06d4 100644 --- a/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb +++ b/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_adaptive_mt_dataset # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb b/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb index 29872e05598f..f93a1dc168a2 100755 --- a/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb +++ b/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Translate::V3::TranslationService::Client#create_glossary. # def create_glossary # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb b/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb index 1b83491a16c6..24a93be0c44e 100644 --- a/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb +++ b/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_adaptive_mt_dataset # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb b/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb index e70919b109d4..13408a956bae 100644 --- a/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb +++ b/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_adaptive_mt_file # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb b/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb index 4ea13822cc6e..40108a55a5af 100755 --- a/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb +++ b/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary. # def delete_glossary # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/detect_language.rb b/google-cloud-translate-v3/snippets/translation_service/detect_language.rb index 96a92424e0d3..95a28dc7abe7 100755 --- a/google-cloud-translate-v3/snippets/translation_service/detect_language.rb +++ b/google-cloud-translate-v3/snippets/translation_service/detect_language.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Translate::V3::TranslationService::Client#detect_language. # def detect_language # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb b/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb index bb4c4cc2f1f2..a48d01718f48 100644 --- a/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb +++ b/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_adaptive_mt_dataset # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb b/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb index 831a369474b9..642e8995b0b7 100644 --- a/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb +++ b/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_adaptive_mt_file # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb b/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb index df7eeab9acf0..7e72dbbc3fda 100755 --- a/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb +++ b/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb @@ -22,9 +22,14 @@ ## # 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. It may -# require modification in order to execute successfully. +# Google::Cloud::Translate::V3::TranslationService::Client#get_glossary. # def get_glossary # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb b/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb index 4d4bff4eab26..98f4a9864a1d 100755 --- a/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb +++ b/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_supported_languages # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb b/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb index 2f6ac3e77cc4..24d616eaee83 100644 --- a/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb +++ b/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def import_adaptive_mt_file # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb b/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb index 776367bb78eb..3fa4128b4099 100644 --- a/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb +++ b/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_adaptive_mt_datasets # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb b/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb index f8d551d95959..3516dcd16fc6 100644 --- a/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb +++ b/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_adaptive_mt_files # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb b/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb index cb4441826faa..c2cbe67e69c4 100644 --- a/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb +++ b/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_adaptive_mt_sentences # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb b/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb index dc56e65c31fb..187e82a1d090 100755 --- a/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb +++ b/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Translate::V3::TranslationService::Client#list_glossaries. # def list_glossaries # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/translate_document.rb b/google-cloud-translate-v3/snippets/translation_service/translate_document.rb index c8c7356ba20f..cf5b109c52c0 100755 --- a/google-cloud-translate-v3/snippets/translation_service/translate_document.rb +++ b/google-cloud-translate-v3/snippets/translation_service/translate_document.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def translate_document # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-translate-v3/snippets/translation_service/translate_text.rb b/google-cloud-translate-v3/snippets/translation_service/translate_text.rb index 12caa8acc604..a553d009f041 100755 --- a/google-cloud-translate-v3/snippets/translation_service/translate_text.rb +++ b/google-cloud-translate-v3/snippets/translation_service/translate_text.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Translate::V3::TranslationService::Client#translate_text. # def translate_text # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/.owlbot-manifest.json b/google-cloud-video-live_stream-v1/.owlbot-manifest.json index d1ef98e6d931..a525de5b7373 100644 --- a/google-cloud-video-live_stream-v1/.owlbot-manifest.json +++ b/google-cloud-video-live_stream-v1/.owlbot-manifest.json @@ -3,6 +3,7 @@ ".gitignore", ".repo-metadata.json", ".rubocop.yml", + ".toys.rb", ".yardopts", "AUTHENTICATION.md", "CHANGELOG.md", diff --git a/owl-bot-staging/google-cloud-tpu-v1/.toys.rb b/google-cloud-video-live_stream-v1/.toys.rb similarity index 100% rename from owl-bot-staging/google-cloud-tpu-v1/.toys.rb rename to google-cloud-video-live_stream-v1/.toys.rb diff --git a/google-cloud-video-live_stream-v1/AUTHENTICATION.md b/google-cloud-video-live_stream-v1/AUTHENTICATION.md index 0bd5d63c4436..7132dc94ea28 100644 --- a/google-cloud-video-live_stream-v1/AUTHENTICATION.md +++ b/google-cloud-video-live_stream-v1/AUTHENTICATION.md @@ -1,149 +1,122 @@ # Authentication -In general, the google-cloud-video-live_stream-v1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. +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 -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). +The following example shows how to set up authentication for a local development +environment with your user credentials. -```sh -export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. -```ruby -require "google/cloud/video/live_stream/v1" +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +```sh +gcloud auth application-default login ``` -## Credential Lookup - -The google-cloud-video-live_stream-v1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments +3. Write code as if already authenticated. -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 discovered automatically. -Code should be written 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). -### Environment Variables +## Credential Lookup -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. +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. -The environment variables that google-cloud-video-live_stream-v1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Video::LiveStream::V1::LivestreamService::Credentials}): +Credentials are accepted in the following ways, in the following order or precedence: -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file +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) -```ruby -require "google/cloud/video/live_stream/v1" - -ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json" +### Configuration -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -``` +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). -### Configuration +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 path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end ``` -Or globally for all clients: +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/keyfile.json" + config.credentials = "path/to/credentialfile.json" end client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new ``` -### Cloud SDK +### Environment Variables -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. +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. -To configure your system for this, simply: +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). -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. +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: -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file -## Creating a Service Account +```ruby +require "google/cloud/video/live_stream/v1" -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-video-live_stream-v1. +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. +client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +``` -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. +### Local ADC file - *Note: You may need to enable billing in order to use these services.* +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. -4. Select **Credentials** from the side navigation. +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. +### Google Cloud Platform environments - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. +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. - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. +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/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec b/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec index 02dad7187643..50386ecb7aeb 100644 --- a/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec +++ b/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec @@ -23,9 +23,9 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.3" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb index 9fb935203bbc..85d3c2245c54 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb @@ -36,6 +36,9 @@ module LivestreamService # Protocol (RTMP) and Secure Reliable Transport (SRT). # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -146,6 +149,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @livestream_service_stub.universe_domain + end + ## # Create a new LivestreamService client object. # @@ -179,8 +191,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -193,18 +206,22 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @location_client = Google::Cloud::Location::Locations::Client.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, + 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 @@ -2559,9 +2576,9 @@ def update_pool request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"livestream.googleapis.com"`. - # @return [::String] + # 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 @@ -2607,13 +2624,20 @@ def update_pool request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "livestream.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -2628,6 +2652,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb index 72fc07f5c49f..1dd7e947c408 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb @@ -27,6 +27,9 @@ module V1 module LivestreamService # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -61,6 +64,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -91,8 +103,10 @@ def initialize @operations_stub = ::Gapic::ServiceStub.new( ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, + 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 @@ -614,9 +628,9 @@ def wait_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"livestream.googleapis.com"`. - # @return [::String] + # 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 @@ -662,13 +676,20 @@ def wait_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "livestream.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC @@ -683,6 +704,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb index 7e3ce4e26d70..509f6ac2eab5 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb @@ -38,6 +38,9 @@ module Rest # Protocol (RTMP) and Secure Reliable Transport (SRT). # class Client + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + include Paths # @private @@ -148,6 +151,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @livestream_service_stub.universe_domain + end + ## # Create a new LivestreamService REST client object. # @@ -175,8 +187,9 @@ def initialize 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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") + 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) @@ -190,16 +203,23 @@ def initialize config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain end @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain config.bindings_override = @config.bindings_override end - @livestream_service_stub = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + @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 + ) end ## @@ -2392,9 +2412,9 @@ def update_pool request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"livestream.googleapis.com"`. - # @return [::String] + # 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 @@ -2431,13 +2451,20 @@ def update_pool request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "livestream.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -2449,6 +2476,7 @@ class Configuration 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 diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb index cbbc994d39a0..56ed40061e67 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb @@ -27,6 +27,9 @@ module LivestreamService module Rest # Service that implements Longrunning Operations API. class Operations + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + # @private attr_reader :operations_stub @@ -61,6 +64,15 @@ def configure @config end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + ## # Create a new Operations client object. # @@ -85,8 +97,10 @@ def initialize @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - credentials: credentials + 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 @@ -479,9 +493,9 @@ def cancel_operation request, options = nil # end # # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"livestream.googleapis.com"`. - # @return [::String] + # 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 @@ -518,13 +532,20 @@ def cancel_operation request, options = nil # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] # class Configuration extend ::Gapic::Config + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "livestream.googleapis.com" - config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } @@ -536,6 +557,7 @@ class Configuration config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil # @private def initialize parent_config = nil @@ -618,12 +640,15 @@ def initialize parent_rpcs = nil # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. class OperationsServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials end ## diff --git a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb index 16f8a7252a79..2095bc3038c6 100644 --- a/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb +++ b/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb @@ -31,16 +31,28 @@ module Rest # including transcoding, making the REST call, and deserialing the response. # class ServiceStub - def initialize endpoint:, credentials: + 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, credentials: credentials, + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, numeric_enums: true, raise_faraday_errors: false end + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + ## # Baseline implementation for the create_channel REST call # diff --git a/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb b/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb index 31fe6bba3132..b62dfdf37219 100644 --- a/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb +++ b/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb @@ -21,6 +21,7 @@ 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 diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb index e9decfd35b4d..da1dac93eb5c 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_asset # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb index 1b828740dd94..038636d0ee3d 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_channel # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb index 430ecb613fac..47c3ecee0826 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_event # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb index fae03d236802..89bb57c25990 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def create_input # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb index 6ce02741d542..abfe73166523 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_asset # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb index d27e4513c7ba..8a1fe2458e2a 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_channel # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb index 3adc63a3a3e5..8bfd566dcf5d 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_event # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb index 49a577ccfd61..b4f91e8ffc1f 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def delete_input # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb index 031700656fe9..b83b6a8af177 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_asset. # def get_asset # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb index f1067d18973d..f2ba7673d3fa 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def get_channel # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb index 64c3de61cf5b..97560f1fe9da 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_event. # def get_event # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb index 0ec794657109..1d114e949245 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_input. # def get_input # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb index d2cdeddef02d..2397b0edeb50 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb @@ -22,9 +22,14 @@ ## # 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. It -# may require modification in order to execute successfully. +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_pool. # def get_pool # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb index f1bc359cc726..9977be9f1271 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_assets # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb index 62fc6eeda806..19cb0eea59f7 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_channels # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb index f77d62aaf803..1c577f1b5ccd 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_events # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb index 92ca9533ca22..9d027e69082f 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def list_inputs # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb index e5c7919ed2ff..76deb8f19001 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def start_channel # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb index c3336d11e865..164b8dd38d22 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def stop_channel # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb index 55111485cb85..0da9541f2534 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def update_channel # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb index 544f08b6a95b..2b308c23d2c4 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def update_input # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb index 3801ae2c8dae..c17e82ad56f2 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb @@ -22,9 +22,14 @@ ## # 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. -# It may require modification in order to execute successfully. # def update_pool # Create a client object. The client can be reused for multiple calls. diff --git a/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json b/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json index 516dafe55703..a7649f68e4e2 100644 --- a/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json +++ b/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json @@ -14,7 +14,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -54,7 +54,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -94,7 +94,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -134,7 +134,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -174,7 +174,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -214,7 +214,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -254,7 +254,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -294,7 +294,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -334,7 +334,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -374,7 +374,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -414,7 +414,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -454,7 +454,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -494,7 +494,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -534,7 +534,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -574,7 +574,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -614,7 +614,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -654,7 +654,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -694,7 +694,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] @@ -734,7 +734,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -774,7 +774,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 45, + "end": 50, "type": "FULL" } ] @@ -814,7 +814,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 46, "type": "FULL" } ] @@ -854,7 +854,7 @@ { "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. It may require modification in order to execute successfully.", + "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": { @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 48, + "end": 53, "type": "FULL" } ] 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 4adf7a6fbde8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 a931889649bf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-talent-v4" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-talent-v4" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 958fa9498817..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 8c3e7a303c50..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 87f014156c47..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d902e49c978e..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 => e - # 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 943dfc059f5e..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 => e - # 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 9cc3235e0612..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3e94a46857db..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb +++ /dev/null @@ -1,855 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 311bea5fc240..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3ab5884f5f12..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d43389afea7a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 f4e03fd42b40..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb +++ /dev/null @@ -1,794 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 2b49ffe71bd3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 fe63da15d067..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\x82\xd3\xe4\x93\x02\x36\"+/v4/{parent=projects/*/tenants/*}/companies:\x07\x63ompany\xda\x41\x0eparent,company\x12\x94\x01\n\nGetCompany\x12).google.cloud.talent.v4.GetCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\":\x82\xd3\xe4\x93\x02-\x12+/v4/{name=projects/*/tenants/*/companies/*}\xda\x41\x04name\x12\xba\x01\n\rUpdateCompany\x12,.google.cloud.talent.v4.UpdateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"Z\x82\xd3\xe4\x93\x02>23/v4/{company.name=projects/*/tenants/*/companies/*}:\x07\x63ompany\xda\x41\x13\x63ompany,update_mask\x12\x91\x01\n\rDeleteCompany\x12,.google.cloud.talent.v4.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\":\x82\xd3\xe4\x93\x02-*+/v4/{name=projects/*/tenants/*/companies/*}\xda\x41\x04name\x12\xaa\x01\n\rListCompanies\x12,.google.cloud.talent.v4.ListCompaniesRequest\x1a-.google.cloud.talent.v4.ListCompaniesResponse\"<\x82\xd3\xe4\x93\x02-\x12+/v4/{parent=projects/*/tenants/*}/companies\xda\x41\x06parent\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 => e - # 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 9ce296b28571..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 93523b2bca83..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 54fb13cd63d5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb +++ /dev/null @@ -1,457 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 9d28028b4d76..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 af16e7ba47e8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 dfc40dbe31bb..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 476cdd0a63c1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb +++ /dev/null @@ -1,424 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 a00d9f27c3da..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb +++ /dev/null @@ -1,119 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 c5168b78f0a5..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 => e - # 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 fb447ac1daff..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 122ca2a7f163..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 => e - # 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 4fcbdf779766..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 855eda2b14de..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb +++ /dev/null @@ -1,435 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 851bd92327bd..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 02c08dfc9594..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 083141623e03..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 23643c66bd67..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb +++ /dev/null @@ -1,402 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 5793a9e7c62e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ClientEvent.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 febe8b16e2d6..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\x82\xd3\xe4\x93\x02>\"./v4/{parent=projects/*/tenants/*}/clientEvents:\x0c\x63lient_event\xda\x41\x13parent,client_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 => e - # 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 9203107295ba..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 e8fca3ff9aa5..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 => e - # 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 b43771376256..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 => e - # 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 85cf3095a1fa..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 => e - # 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 f9e2bb8f59c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 2cb1f19aa6d0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb +++ /dev/null @@ -1,1993 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4::JobService::Operations] - # - attr_reader :operations_client - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 - # [JobResult][JobOperationResult.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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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) - # 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. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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 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) - # 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. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 273522adb7f8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 937988b200ae..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb +++ /dev/null @@ -1,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Talent - module V4 - module JobService - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 d96a228ddc54..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 b0ed7b98329c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4b26a52c59ae..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb +++ /dev/null @@ -1,1897 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4::JobService::Rest::Operations] - # - attr_reader :operations_client - - # 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # [JobResult][JobOperationResult.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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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) - # 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 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) - # 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 a30150d0bf37..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb +++ /dev/null @@ -1,895 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Talent - module V4 - module JobService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^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 ad14379ca349..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +++ /dev/null @@ -1,657 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 a18816c7604d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb +++ /dev/null @@ -1,85 +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\"\xd7\x0b\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\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\"\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\"@\x82\xd3\xe4\x93\x02-\"&/v4/{parent=projects/*/tenants/*}/jobs:\x03job\xda\x41\nparent,job\x12\xe1\x01\n\x0f\x42\x61tchCreateJobs\x12..google.cloud.talent.v4.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*\xda\x41\x0bparent,jobs\xca\x41\x31\n\x17\x42\x61tchCreateJobsResponse\x12\x16\x42\x61tchOperationMetadata\x12\x83\x01\n\x06GetJob\x12%.google.cloud.talent.v4.GetJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"5\x82\xd3\xe4\x93\x02(\x12&/v4/{name=projects/*/tenants/*/jobs/*}\xda\x41\x04name\x12\x9d\x01\n\tUpdateJob\x12(.google.cloud.talent.v4.UpdateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"I\x82\xd3\xe4\x93\x02\x31\x32*/v4/{job.name=projects/*/tenants/*/jobs/*}:\x03job\xda\x41\x0fjob,update_mask\x12\xe1\x01\n\x0f\x42\x61tchUpdateJobs\x12..google.cloud.talent.v4.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*\xda\x41\x0bparent,jobs\xca\x41\x31\n\x17\x42\x61tchUpdateJobsResponse\x12\x16\x42\x61tchOperationMetadata\x12\x84\x01\n\tDeleteJob\x12(.google.cloud.talent.v4.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02(*&/v4/{name=projects/*/tenants/*/jobs/*}\xda\x41\x04name\x12\xe3\x01\n\x0f\x42\x61tchDeleteJobs\x12..google.cloud.talent.v4.BatchDeleteJobsRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*\xda\x41\x0cparent,names\xca\x41\x31\n\x17\x42\x61tchDeleteJobsResponse\x12\x16\x42\x61tchOperationMetadata\x12\x9d\x01\n\x08ListJobs\x12\'.google.cloud.talent.v4.ListJobsRequest\x1a(.google.cloud.talent.v4.ListJobsResponse\">\x82\xd3\xe4\x93\x02(\x12&/v4/{parent=projects/*/tenants/*}/jobs\xda\x41\rparent,filter\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 => e - # 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 - 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 b17bdf97d706..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 258ce6428509..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 364697a3a0bf..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 => e - # 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 aaa361f7ec6d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ae018a1a28fb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 a0aeb3dd68c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 567f45b026a3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 71cf69f0ea33..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8e44239c5fb2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb +++ /dev/null @@ -1,782 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 f02b12385954..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 08e1c3e71fc1..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\"?\x82\xd3\xe4\x93\x02)\"\x1f/v4/{parent=projects/*}/tenants:\x06tenant\xda\x41\rparent,tenant\x12\x85\x01\n\tGetTenant\x12(.google.cloud.talent.v4.GetTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\".\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa8\x01\n\x0cUpdateTenant\x12+.google.cloud.talent.v4.UpdateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"K\x82\xd3\xe4\x93\x02\x30\x32&/v4/{tenant.name=projects/*/tenants/*}:\x06tenant\xda\x41\x12tenant,update_mask\x12\x83\x01\n\x0c\x44\x65leteTenant\x12+.google.cloud.talent.v4.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02!*\x1f/v4/{name=projects/*/tenants/*}\xda\x41\x04name\x12\x98\x01\n\x0bListTenants\x12*.google.cloud.talent.v4.ListTenantsRequest\x1a+.google.cloud.talent.v4.ListTenantsResponse\"0\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{parent=projects/*}/tenants\xda\x41\x06parent\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 => e - # 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 2bc513e2ff1e..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 979a066ca4a8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 9f2c4b47ca9a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb +++ /dev/null @@ -1,955 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Compensation range. - # @!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 07bca824bf6f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 a30342743d8f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 5b6cf0e9a8df..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 415e250f1de6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6ed831f0dd6a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 987748d3196b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb +++ /dev/null @@ -1,387 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 [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. - 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. - # @!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. - 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 dcc1f36b8014..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 1b71e80fa8f5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # [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 [LocationType.STREET_ADDRESS][] and the - # second is a [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 [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::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 ca9cd837ef35..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb +++ /dev/null @@ -1,901 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - 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 - 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 - # [JobResult][JobOperationResult.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 62cf1d493004..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4165d1a657e0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 5160138862c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 0d9e1c6995f8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 e3dfd2f9ecda..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 07d77c5d3183..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 dcbd7c6bd3f8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 cdca6505f7cd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 1f146401f2fb..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 86a1bdc2e884..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fd2ea4214115..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b13065ea79d8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5194a5c322b0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8ead9abf6fed..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7af28897d788..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 420a6572b0df..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b5d242f9eb2c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1da8f1a05334..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1c6deeefa6f9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ca1249903d11..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 76184e0e2c44..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1a0d85390aa8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c708cce0b531..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0394f61d2543..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3025eb8d219c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 68676630eb46..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 aefa4dfede93..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0d8496263412..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4f5385751409..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 da69aff3321c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 736e3b8d9cd4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/company_service" - -class ::Google::Cloud::Talent::V4::CompanyService::ClientPathsTest < Minitest::Test - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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 cd146ed9d2ea..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 c9aeca65e0cb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb +++ /dev/null @@ -1,372 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 6f05e616090f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/completion" - -class ::Google::Cloud::Talent::V4::Completion::ClientPathsTest < Minitest::Test - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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 4355b2773178..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 9411f7a30bfd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 6b81587c0e54..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/event_service" - -class ::Google::Cloud::Talent::V4::EventService::ClientPathsTest < Minitest::Test - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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 12efc940feb1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 9a9e44612bb5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 b3105de095ec..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 8d3ccba1b83e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::ClientPathsTest < Minitest::Test - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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 820fd209daaa..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb +++ /dev/null @@ -1,660 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - - search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 - - search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 - Gapic::Rest::ClientStub.stub :new, nil 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 6f7b3a81665c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb +++ /dev/null @@ -1,756 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 - - 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"] - 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 }) 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 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) 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 }, 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), 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 - - 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"] - 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 }) 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 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) 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 }, 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), 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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 358c63350621..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/tenant_service" - -class ::Google::Cloud::Talent::V4::TenantService::ClientPathsTest < Minitest::Test - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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 805e040c0919..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb +++ /dev/null @@ -1,356 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 31bf66b62fc9..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb +++ /dev/null @@ -1,370 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 fa52d4701773..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 1500b971f9d8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-talent-v4beta1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-talent-v4beta1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 9073d25b0aa2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 044203662536..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 4fc2bf6ce686..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 998b03c93734..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 => e - # 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 f4cde3a7a5a1..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 => e - # 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 0f816d37791c..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 => e - # 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 b3a8779825e6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 db8b134f15a9..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb +++ /dev/null @@ -1,866 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 30a253307b1a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 70bc24aef672..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 7d55dc966ed5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 2c13936322b3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +++ /dev/null @@ -1,805 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 fe7deed0b817..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +++ /dev/null @@ -1,394 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 48ce26b1a5f8..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\x82\xd3\xe4\x93\x02\x62\"0/v4beta1/{parent=projects/*/tenants/*}/companies:\x01*Z+\"&/v4beta1/{parent=projects/*}/companies:\x01*\xda\x41\x0eparent,company\x12\xcd\x01\n\nGetCompany\x12..google.cloud.talent.v4beta1.GetCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"i\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{name=projects/*/tenants/*/companies/*}Z(\x12&/v4beta1/{name=projects/*/companies/*}\xda\x41\x04name\x12\xed\x01\n\rUpdateCompany\x12\x31.google.cloud.talent.v4beta1.UpdateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"\x82\x01\x82\xd3\xe4\x93\x02r28/v4beta1/{company.name=projects/*/tenants/*/companies/*}:\x01*Z32./v4beta1/{company.name=projects/*/companies/*}:\x01*\xda\x41\x07\x63ompany\x12\xc5\x01\n\rDeleteCompany\x12\x31.google.cloud.talent.v4beta1.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\"i\x82\xd3\xe4\x93\x02\\*0/v4beta1/{name=projects/*/tenants/*/companies/*}Z(*&/v4beta1/{name=projects/*/companies/*}\xda\x41\x04name\x12\xe3\x01\n\rListCompanies\x12\x31.google.cloud.talent.v4beta1.ListCompaniesRequest\x1a\x32.google.cloud.talent.v4beta1.ListCompaniesResponse\"k\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{parent=projects/*/tenants/*}/companiesZ(\x12&/v4beta1/{parent=projects/*}/companies\xda\x41\x06parent\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 => e - # 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 a247d6ec589f..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 36c6d2ada699..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d4bc4a70cbd4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb +++ /dev/null @@ -1,463 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 bd98fbefb5be..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 aa4058fb97c3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8ccf53cdef95..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 2f82bb8470ee..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +++ /dev/null @@ -1,430 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 2eccb41f271a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 072b50f489d1..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 => e - # 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 f0a365aae693..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 3e0e04dcc957..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 => e - # 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 139590521aaf..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 bbea662f500e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb +++ /dev/null @@ -1,436 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 f1221c88f266..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 aa9b5734303f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 65e44b6a204f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 faca2cedaef0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +++ /dev/null @@ -1,403 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 a71c9edcad9e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ClientEvent.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 3973345eb132..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\x82\xd3\xe4\x93\x02h\"3/v4beta1/{parent=projects/*/tenants/*}/clientEvents:\x01*Z.\")/v4beta1/{parent=projects/*}/clientEvents:\x01*\xda\x41\x13parent,client_event\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 => e - # 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 8186a98c2640..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 098036df6773..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 => e - # 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 528232daf6b9..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 => e - # 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 594408c0aff4..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 => e - # 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 2fa79b24874a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 cf7b406cf736..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb +++ /dev/null @@ -1,2015 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4beta1::JobService::Operations] - # - attr_reader :operations_client - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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::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 and x-goog-user-project headers - metadata[:"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-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? - return 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) - # 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. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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 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) - # 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. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 8f94dca95313..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9858d17bb233..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb +++ /dev/null @@ -1,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module JobService - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 eacabc066977..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 20d4d8e9c5bb..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0c4bb45f9b25..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +++ /dev/null @@ -1,1919 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4beta1::JobService::Rest::Operations] - # - attr_reader :operations_client - - # 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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::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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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) - # 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 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) - # 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 34c3d15026bc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +++ /dev/null @@ -1,895 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Talent - module V4beta1 - module JobService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^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 57b55bb33953..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +++ /dev/null @@ -1,733 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 6fe2ae9c07d2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb +++ /dev/null @@ -1,83 +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\"\xbb\x0b\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\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\"\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\x82\xd3\xe4\x93\x02X\"+/v4beta1/{parent=projects/*/tenants/*}/jobs:\x01*Z&\"!/v4beta1/{parent=projects/*}/jobs:\x01*\xda\x41\nparent,job\x12\x9b\x02\n\x0f\x42\x61tchCreateJobs\x12\x33.google.cloud.talent.v4beta1.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchCreate:\x01*\xda\x41\x0bparent,jobs\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\x12\xb7\x01\n\x06GetJob\x12*.google.cloud.talent.v4beta1.GetJobRequest\x1a .google.cloud.talent.v4beta1.Job\"_\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#\x12!/v4beta1/{name=projects/*/jobs/*}\xda\x41\x04name\x12\xca\x01\n\tUpdateJob\x12-.google.cloud.talent.v4beta1.UpdateJobRequest\x1a .google.cloud.talent.v4beta1.Job\"l\x82\xd3\xe4\x93\x02`2//v4beta1/{job.name=projects/*/tenants/*/jobs/*}:\x01*Z*2%/v4beta1/{job.name=projects/*/jobs/*}:\x01*\xda\x41\x03job\x12\x9b\x02\n\x0f\x42\x61tchUpdateJobs\x12\x33.google.cloud.talent.v4beta1.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchUpdate:\x01*\xda\x41\x0bparent,jobs\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\x12\xb3\x01\n\tDeleteJob\x12-.google.cloud.talent.v4beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"_\x82\xd3\xe4\x93\x02R*+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#*!/v4beta1/{name=projects/*/jobs/*}\xda\x41\x04name\x12\xe4\x01\n\x0f\x42\x61tchDeleteJobs\x12\x33.google.cloud.talent.v4beta1.BatchDeleteJobsRequest\x1a\x16.google.protobuf.Empty\"\x83\x01\x82\xd3\xe4\x93\x02m\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*Z/\"-/v4beta1/{parent=projects/*}/jobs:batchDelete\xda\x41\rparent,filter\x12\xd1\x01\n\x08ListJobs\x12,.google.cloud.talent.v4beta1.ListJobsRequest\x1a-.google.cloud.talent.v4beta1.ListJobsResponse\"h\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{parent=projects/*/tenants/*}/jobsZ#\x12!/v4beta1/{parent=projects/*}/jobs\xda\x41\rparent,filter\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 => e - # 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 - 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 c4f78e682c11..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 babfc9227da4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5080a4867c49..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 => e - # 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 f0dc434284d3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6d6de55ac117..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +++ /dev/null @@ -1,845 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 369df16e9b9e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c8f2df3a59c7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6d2d6a0e6d2b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ce352d7f4d9d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +++ /dev/null @@ -1,784 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 7d56ab92e31e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 77c332c9020c..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\"?\x82\xd3\xe4\x93\x02)\"$/v4beta1/{parent=projects/*}/tenants:\x01*\xda\x41\rparent,tenant\x12\x94\x01\n\tGetTenant\x12-.google.cloud.talent.v4beta1.GetTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"3\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa6\x01\n\x0cUpdateTenant\x12\x30.google.cloud.talent.v4beta1.UpdateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"?\x82\xd3\xe4\x93\x02\x30\x32+/v4beta1/{tenant.name=projects/*/tenants/*}:\x01*\xda\x41\x06tenant\x12\x8d\x01\n\x0c\x44\x65leteTenant\x12\x30.google.cloud.talent.v4beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\"3\x82\xd3\xe4\x93\x02&*$/v4beta1/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa7\x01\n\x0bListTenants\x12/.google.cloud.talent.v4beta1.ListTenantsRequest\x1a\x30.google.cloud.talent.v4beta1.ListTenantsResponse\"5\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{parent=projects/*}/tenants\xda\x41\x06parent\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 => e - # 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 36bca3dac164..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 8a4c987ae10f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 f1c6b139192b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb +++ /dev/null @@ -1,951 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] - # Compensation range. - # @!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 471b0478d561..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 a6f172bc8d0e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 3a70916d17e0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 70ec7dd37186..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6e52913ccde0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 73f96155f69a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!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. - 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 9f13ab009987..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 b65ab47e42d1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8d83d8ed4cc6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb +++ /dev/null @@ -1,886 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - 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 - 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 bcdf81580e2b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 867219fb700c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 5160138862c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 0d9e1c6995f8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 e3dfd2f9ecda..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 07d77c5d3183..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 dcbd7c6bd3f8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 2726aed1b15f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 e32b44071cb1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9814f5de3e7a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1b7ceb85ab0b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7716203fd160..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8074bfe1dc7a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 95f073376570..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 98ea7861d207..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c01bb3ff74cb..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5ad0c86b6dc7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ea79991170be..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0510c335749b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a9857529e236..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b18f1d2dd1c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 02e4ccea1de1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3297a5d94715..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5fc9281fa51f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c88d07a68c7a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9a252f88caa8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1277b423319f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 f6058c750c47..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ad9751932c14..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3be917ea99b2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a79fc60d2ebc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/company_service" - -class ::Google::Cloud::Talent::V4beta1::CompanyService::ClientPathsTest < Minitest::Test - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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 eac627bf8bee..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb +++ /dev/null @@ -1,357 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 633ff7cd228d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb +++ /dev/null @@ -1,372 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/company_service_pb" -require "google/cloud/talent/v4beta1/company_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 ab932dd53e0f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/completion" - -class ::Google::Cloud::Talent::V4beta1::Completion::ClientPathsTest < Minitest::Test - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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 bf03cd1bba69..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 94df96619d6e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/completion_service_pb" -require "google/cloud/talent/v4beta1/completion_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 cafe78a55342..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/event_service" - -class ::Google::Cloud::Talent::V4beta1::EventService::ClientPathsTest < Minitest::Test - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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 bfa233ce13d7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 014474f91f28..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/event_service_pb" -require "google/cloud/talent/v4beta1/event_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 1cb22bbecf93..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 1f66d979761f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/job_service" - -class ::Google::Cloud::Talent::V4beta1::JobService::ClientPathsTest < Minitest::Test - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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 f236a7418c7e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb +++ /dev/null @@ -1,662 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - - search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 - - search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 - Gapic::Rest::ClientStub.stub :new, nil 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 030340d45923..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb +++ /dev/null @@ -1,755 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 - - 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"] - 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 }) 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 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) 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 }, 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), 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 - - 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"] - 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 }) 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 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) 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 }, 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), 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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 81001d4fabf6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/tenant_service" - -class ::Google::Cloud::Talent::V4beta1::TenantService::ClientPathsTest < Minitest::Test - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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 ddff8830a106..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb +++ /dev/null @@ -1,356 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 29db907e24cc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb +++ /dev/null @@ -1,370 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/talent/v4beta1/tenant_service_pb" -require "google/cloud/talent/v4beta1/tenant_service_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.yardopts b/owl-bot-staging/google-cloud-talent/.yardopts deleted file mode 100644 index 6311b6b66212..000000000000 --- a/owl-bot-staging/google-cloud-talent/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Talent Solution 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-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 1b4779f0da9e..000000000000 --- a/owl-bot-staging/google-cloud-talent/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-talent-v4", path: "../google-cloud-talent-v4" -gem "google-cloud-talent-v4beta1", path: "../google-cloud-talent-v4beta1" 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 28b03d6a9101..000000000000 --- a/owl-bot-staging/google-cloud-talent/README.md +++ /dev/null @@ -1,113 +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 -verisoned 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), -[google-cloud-talent-v4beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/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. {file:AUTHENTICATION.md Set up authentication.} - -## Migrating from pre-0.20 versions - -The 0.20 release of the google-cloud-talent 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. - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 356311dba40a..000000000000 --- a/owl-bot-staging/google-cloud-talent/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-talent" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-talent" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 e15413e3a3cb..000000000000 --- a/owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec +++ /dev/null @@ -1,37 +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", "MIGRATING.md"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-talent-v4", ">= 0.9", "< 2.a" - gem.add_dependency "google-cloud-talent-v4beta1", ">= 0.7", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -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 61b063159695..000000000000 --- a/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 636e6606024e..000000000000 --- a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb +++ /dev/null @@ -1,255 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require 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, "jobs.googleapis.com", 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 -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. - # - # ## 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 - - ## - # 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. - # - # ## 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 - - ## - # 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. - # - # ## 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 - - ## - # 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. - # - # ## 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 - - ## - # 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. - # - # ## 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 - - ## - # 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 37adb261913a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 2d75244acff7..000000000000 --- a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/talent" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Talent::ClientConstructionMinitest < Minitest::Test - def test_company_service_grpc - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 4968c43b28f4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-talent/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 5c006854efed..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 db4260be85e3..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks-v2" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks-v2" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 388e8e27656b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec +++ /dev/null @@ -1,39 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - gem.add_dependency "grpc-google-iam-v1", "~> 1.1" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 f23232a26cde..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 9051b8c455e7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7dec9e645f03..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module 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 = Configuration.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 - - ## - # @private - # Configuration class for the google.cloud.tasks.v2 package. - # - # This class contains common configuration for all services - # of the google.cloud.tasks.v2 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 9cd5ecbd97ce..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 aef189d3770a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb +++ /dev/null @@ -1,2203 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @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 - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 - # {::Google::Cloud::Location::Locations::Client#list_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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 5cbb18569c6f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 817654d24d5e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 fcd3552d4ec7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 cd28dec58d7b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb +++ /dev/null @@ -1,2073 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - - @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 - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # {::Google::Cloud::Location::Locations::Rest::Client#list_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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 0adda575f690..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb +++ /dev/null @@ -1,1014 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 fc6370b20efe..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\";\x82\xd3\xe4\x93\x02,\x12*/v2/{parent=projects/*/locations/*}/queues\xda\x41\x06parent\x12\x8b\x01\n\x08GetQueue\x12&.google.cloud.tasks.v2.GetQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"9\x82\xd3\xe4\x93\x02,\x12*/v2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xa0\x01\n\x0b\x43reateQueue\x12).google.cloud.tasks.v2.CreateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"H\x82\xd3\xe4\x93\x02\x33\"*/v2/{parent=projects/*/locations/*}/queues:\x05queue\xda\x41\x0cparent,queue\x12\xab\x01\n\x0bUpdateQueue\x12).google.cloud.tasks.v2.UpdateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"S\x82\xd3\xe4\x93\x02\x39\x32\x30/v2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\xda\x41\x11queue,update_mask\x12\x8b\x01\n\x0b\x44\x65leteQueue\x12).google.cloud.tasks.v2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02,**/v2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\x98\x01\n\nPurgeQueue\x12(.google.cloud.tasks.v2.PurgeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:purge:\x01*\xda\x41\x04name\x12\x98\x01\n\nPauseQueue\x12(.google.cloud.tasks.v2.PauseQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:pause:\x01*\xda\x41\x04name\x12\x9b\x01\n\x0bResumeQueue\x12).google.cloud.tasks.v2.ResumeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"C\x82\xd3\xe4\x93\x02\x36\"1/v2/{name=projects/*/locations/*/queues/*}:resume:\x01*\xda\x41\x04name\x12\x9c\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"Q\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa3\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xce\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"c\x82\xd3\xe4\x93\x02\x46\"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xa3\x01\n\tListTasks\x12\'.google.cloud.tasks.v2.ListTasksRequest\x1a(.google.cloud.tasks.v2.ListTasksResponse\"C\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{parent=projects/*/locations/*/queues/*}/tasks\xda\x41\x06parent\x12\x90\x01\n\x07GetTask\x12%.google.cloud.tasks.v2.GetTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"A\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xa0\x01\n\nCreateTask\x12(.google.cloud.tasks.v2.CreateTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"K\x82\xd3\xe4\x93\x02\x37\"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\xda\x41\x0bparent,task\x12\x91\x01\n\nDeleteTask\x12(.google.cloud.tasks.v2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"A\x82\xd3\xe4\x93\x02\x34*2/v2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\x97\x01\n\x07RunTask\x12%.google.cloud.tasks.v2.RunTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"H\x82\xd3\xe4\x93\x02;\"6/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\xda\x41\x04name\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 => e - # 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 276f3e975372..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 eb67ea374b1a..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 => e - # 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 2f78dc35f4e0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b9c42a713c7c..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 => e - # 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 d3f316ff7626..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 => e - # 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 9acc7df26768..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 95d6c3993e00..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # {::Google::Cloud::Location::Locations::Client#list_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 4b9356eee952..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # {::Google::Cloud::Location::Locations::Client#list_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 7fcecb4742e7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb +++ /dev/null @@ -1,462 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!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. - 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 10676fe58d43..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb +++ /dev/null @@ -1,192 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Location::Locations::Client#list_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. - # @!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. - # @!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 3729ce6dfaa5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d762967fa7ec..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 a916fb4322c7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # {::Google::Iam::V1::Binding#members 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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 41c8c3a565cc..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 b6fc1bbc1015..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 499dda879677..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fe34a0cc9079..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3881a91e82d4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 31817ee6c41e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6795a532de95..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 18321fa5b114..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8d8e1cb937ba..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1c73c3e0712d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 351400794e02..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a0d67affce11..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b6cdb2114570..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d009f1ce4a39..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 25dea0517ec3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0e864ecc2c38..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b70a8f44cc86..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 371fed81e7a0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6bd9f43e812d..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tasks/v2/cloud_tasks" - -class ::Google::Cloud::Tasks::V2::CloudTasks::ClientPathsTest < Minitest::Test - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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 7c5f6b0b02c1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb +++ /dev/null @@ -1,962 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 e6b0847739e9..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb +++ /dev/null @@ -1,1037 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tasks/v2/cloudtasks_pb" -require "google/cloud/tasks/v2/cloudtasks_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 3d5f2b053ac6..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 e72735e95aa8..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks-v2beta2" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks-v2beta2" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 6dee6ad117ab..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json +++ /dev/null @@ -1,128 +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" - ] - }, - "BufferTask": { - "methods": [ - "buffer_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 487a46f001a8..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec +++ /dev/null @@ -1,39 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - gem.add_dependency "grpc-google-iam-v1", "~> 1.1" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 778c2bcbbe6c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 c0e3fb1bea91..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 e4d0e0c9252a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module 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 = Configuration.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 - - ## - # @private - # Configuration class for the google.cloud.tasks.v2beta2 package. - # - # This class contains common configuration for all services - # of the google.cloud.tasks.v2beta2 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 ff99c2c647ee..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b4c28218a21f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb +++ /dev/null @@ -1,2998 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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.rpcs.buffer_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 - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @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 - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 - # {::Google::Cloud::Location::Locations::Client#list_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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates and buffers a new task without the need to explicitly define a Task - # message. The queue must have [HTTP - # target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a - # custom ID, use the following format and set TASK_ID to your desired ID: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - # To create the task with an automatically generated ID, use the following - # format: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - # Note: This feature is in its experimental stage. You must request access to - # the API through the [Cloud Tasks BufferTask Experiment Signup - # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - # - # @overload buffer_task(request, options = nil) - # Pass arguments to `buffer_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::BufferTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload buffer_task(queue: nil, task_id: nil, body: nil) - # Pass arguments to `buffer_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 queue [::String] - # Required. The parent queue name. For example: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task_id [::String] - # Optional. Task ID for the task being created. If not provided, a random - # task ID is assigned to the task. - # @param body [::Google::Api::HttpBody, ::Hash] - # Optional. Body of the HTTP request. - # - # The body can take any generic value. The value is written to the - # [HttpRequest][payload] of the [Task]. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] - # - # @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::BufferTaskRequest.new - # - # # Call the buffer_task method. - # result = client.buffer_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::BufferTaskResponse. - # p result - # - def buffer_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.buffer_task.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.queue - header_params["queue"] = request.queue - end - if request.task_id - header_params["task_id"] = request.task_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.buffer_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.buffer_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :buffer_task, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 - ## - # RPC-specific configuration for `buffer_task` - # @return [::Gapic::Config::Method] - # - attr_reader :buffer_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 - buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task - @buffer_task = ::Gapic::Config::Method.new buffer_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 a8216d057c13..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9c19154afc5e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 b925abd13285..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 25d81d058cdf..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb +++ /dev/null @@ -1,2736 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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.rpcs.buffer_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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - - @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 - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # {::Google::Cloud::Location::Locations::Rest::Client#list_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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates and buffers a new task without the need to explicitly define a Task - # message. The queue must have [HTTP - # target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a - # custom ID, use the following format and set TASK_ID to your desired ID: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - # To create the task with an automatically generated ID, use the following - # format: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - # Note: This feature is in its experimental stage. You must request access to - # the API through the [Cloud Tasks BufferTask Experiment Signup - # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - # - # @overload buffer_task(request, options = nil) - # Pass arguments to `buffer_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::BufferTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload buffer_task(queue: nil, task_id: nil, body: nil) - # Pass arguments to `buffer_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 queue [::String] - # Required. The parent queue name. For example: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task_id [::String] - # Optional. Task ID for the task being created. If not provided, a random - # task ID is assigned to the task. - # @param body [::Google::Api::HttpBody, ::Hash] - # Optional. Body of the HTTP request. - # - # The body can take any generic value. The value is written to the - # [HttpRequest][payload] of the [Task]. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] - # - # @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::BufferTaskRequest.new - # - # # Call the buffer_task method. - # result = client.buffer_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::BufferTaskResponse. - # p result - # - def buffer_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.buffer_task.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.buffer_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.buffer_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.buffer_task request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 - ## - # RPC-specific configuration for `buffer_task` - # @return [::Gapic::Config::Method] - # - attr_reader :buffer_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 - buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task - @buffer_task = ::Gapic::Config::Method.new buffer_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 b280eb6d006f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the buffer_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::BufferTaskResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::BufferTaskResponse] - # A result object deserialized from the server's reply - def buffer_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_buffer_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 - - ## - # @private - # - # GRPC transcoding helper method for the buffer_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::BufferTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_buffer_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{queue}/tasks/{task_id}:buffer", - body: "*", - matches: [ - ["queue", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false], - ["task_id", %r{^[^/]+/?$}, 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 5075b1987422..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb +++ /dev/null @@ -1,84 +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.View\"\x89\x01\n\x11\x42ufferTaskRequest\x12\x35\n\x05queue\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x14\n\x07task_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\'\n\x04\x62ody\x18\x03 \x01(\x0b\x32\x14.google.api.HttpBodyB\x03\xe0\x41\x01\"D\n\x12\x42ufferTaskResponse\x12.\n\x04task\x18\x01 \x01(\x0b\x32 .google.cloud.tasks.v2beta2.Task2\x8c\x1f\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta2.ListQueuesRequest\x1a..google.cloud.tasks.v2beta2.ListQueuesResponse\"@\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{parent=projects/*/locations/*}/queues\xda\x41\x06parent\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta2.GetQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\">\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta2.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"M\x82\xd3\xe4\x93\x02\x38\"//v2beta2/{parent=projects/*/locations/*}/queues:\x05queue\xda\x41\x0cparent,queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta2.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"X\x82\xd3\xe4\x93\x02>25/v2beta2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\xda\x41\x11queue,update_mask\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\x82\xd3\xe4\x93\x02\x31*//v2beta2/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta2.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:purge:\x01*\xda\x41\x04name\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta2.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:pause:\x01*\xda\x41\x04name\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta2.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"H\x82\xd3\xe4\x93\x02;\"6/v2beta2/{name=projects/*/locations/*/queues/*}:resume:\x01*\xda\x41\x04name\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\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\x82\xd3\xe4\x93\x02K\"F/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta2.ListTasksRequest\x1a-.google.cloud.tasks.v2beta2.ListTasksResponse\"H\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks\xda\x41\x06parent\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta2.GetTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"F\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta2.CreateTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"P\x82\xd3\xe4\x93\x02<\"7/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\xda\x41\x0bparent,task\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\x82\xd3\xe4\x93\x02\x39*7/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xcd\x01\n\nLeaseTasks\x12-.google.cloud.tasks.v2beta2.LeaseTasksRequest\x1a..google.cloud.tasks.v2beta2.LeaseTasksResponse\"`\x82\xd3\xe4\x93\x02\x42\"=/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease:\x01*\xda\x41\x15parent,lease_duration\x12\xc2\x01\n\x0f\x41\x63knowledgeTask\x12\x32.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest\x1a\x16.google.protobuf.Empty\"c\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge:\x01*\xda\x41\x12name,schedule_time\x12\xd0\x01\n\nRenewLease\x12-.google.cloud.tasks.v2beta2.RenewLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"q\x82\xd3\xe4\x93\x02G\"B/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease:\x01*\xda\x41!name,schedule_time,lease_duration\x12\xc4\x01\n\x0b\x43\x61ncelLease\x12..google.cloud.tasks.v2beta2.CancelLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"c\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease:\x01*\xda\x41\x12name,schedule_time\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta2.RunTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"M\x82\xd3\xe4\x93\x02@\";/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\xda\x41\x04name\x12\xd4\x01\n\nBufferTask\x12-.google.cloud.tasks.v2beta2.BufferTaskRequest\x1a..google.cloud.tasks.v2beta2.BufferTaskResponse\"g\x82\xd3\xe4\x93\x02L\"G/v2beta2/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer:\x01*\xda\x41\x12queue,task_id,body\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 => e - # 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 - BufferTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.BufferTaskRequest").msgclass - BufferTaskResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.BufferTaskResponse").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 7624ea0dc31f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb +++ /dev/null @@ -1,286 +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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 - # Creates and buffers a new task without the need to explicitly define a Task - # message. The queue must have [HTTP - # target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a - # custom ID, use the following format and set TASK_ID to your desired ID: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - # To create the task with an automatically generated ID, use the following - # format: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - # Note: This feature is in its experimental stage. You must request access to - # the API through the [Cloud Tasks BufferTask Experiment Signup - # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - rpc :BufferTask, ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse - 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 76f6e97cd499..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 => e - # 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 d3536041d6aa..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 => e - # 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 ccdb345175cc..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 908b69603005..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 => e - # 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 5c0c20d849ba..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 => e - # 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 f67829e4ad0a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 79b20abe20f9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 cf1a91615d79..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb +++ /dev/null @@ -1,642 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Location::Locations::Client#list_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 - - # LINT.IfChange - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task BufferTask}. - # @!attribute [rw] queue - # @return [::String] - # Required. The parent queue name. For example: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @!attribute [rw] task_id - # @return [::String] - # Optional. Task ID for the task being created. If not provided, a random - # task ID is assigned to the task. - # @!attribute [rw] body - # @return [::Google::Api::HttpBody] - # Optional. Body of the HTTP request. - # - # The body can take any generic value. The value is written to the - # [HttpRequest][payload] of the [Task]. - class BufferTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task BufferTask}. - # @!attribute [rw] task - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # The created task. - class BufferTaskResponse - 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 236aa4e40b70..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb +++ /dev/null @@ -1,438 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Location::Locations::Client#list_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}. - # @!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}. - # @!attribute [rw] http_target - # @return [::Google::Cloud::Tasks::V2beta2::HttpTarget] - # An http_target is used to override the target values for HTTP tasks. - # @!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. - # @!attribute [rw] unlimited_attempts - # @return [::Boolean] - # If true, then the number of attempts is unlimited. - # @!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 375ba3609ebe..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb +++ /dev/null @@ -1,767 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_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::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. - # @!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. - 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 - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_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::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. - # @!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. - 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 18591ba5f790..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb +++ /dev/null @@ -1,202 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Location::Locations::Client#list_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. - # @!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. - # @!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. - # @!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 3729ce6dfaa5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d762967fa7ec..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 a916fb4322c7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # {::Google::Iam::V1::Binding#members 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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 41c8c3a565cc..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 0b2727003216..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 df67053c75e6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/buffer_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb deleted file mode 100644 index 96b2f3a62447..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/buffer_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudtasks_v2beta2_generated_CloudTasks_BufferTask_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the buffer_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#buffer_task. -# -def buffer_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::BufferTaskRequest.new - - # Call the buffer_task method. - result = client.buffer_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::BufferTaskResponse. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_BufferTask_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 4d6aeb569fd5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 86b1ae535f83..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ac3f759e4915..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1582647ac379..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 01c81fe78217..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3677bb879fa6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b411172aed61..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 53e515774e1a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7e0331d4c068..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7b6598466775..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7e01edefaf4a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0e1ea8512fe7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 e6f48d7b96db..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c9abc74a9ed1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 cc97bd8dcdc1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 da755ab3f463..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a803a14af79c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 be83313568b4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a6ef952ba4ca..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6f3f47e7e696..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 df22fb388f74..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json +++ /dev/null @@ -1,895 +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" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_BufferTask_sync", - "title": "Snippet for the buffer_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task.", - "file": "cloud_tasks/buffer_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "buffer_task", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#buffer_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::BufferTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::BufferTaskResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "BufferTask", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.BufferTask", - "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 9d8a1a121f40..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tasks/v2beta2/cloud_tasks" - -class ::Google::Cloud::Tasks::V2beta2::CloudTasks::ClientPathsTest < Minitest::Test - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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 4050d23b0068..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb +++ /dev/null @@ -1,1246 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_buffer_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - queue = "hello world" - task_id = "hello world" - body = {} - - buffer_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_buffer_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.buffer_task queue: queue, task_id: task_id, body: body do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.buffer_task ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.buffer_task({ queue: queue, task_id: task_id, body: body }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.buffer_task(::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, buffer_task_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil 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 76e6fa069f5e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb +++ /dev/null @@ -1,1416 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tasks/v2beta2/cloudtasks_pb" -require "google/cloud/tasks/v2beta2/cloudtasks_services_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) - - yield @response, @operation if block_given? - - @response - 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_buffer_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::BufferTaskResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - task_id = "hello world" - body = {} - - buffer_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :buffer_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest, request - assert_equal "hello world", request["queue"] - assert_equal "hello world", request["task_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::HttpBody), request["body"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.buffer_task queue: queue, task_id: task_id, body: body do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.buffer_task ::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.buffer_task({ queue: queue, task_id: task_id, body: body }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.buffer_task(::Google::Cloud::Tasks::V2beta2::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, buffer_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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 4a2a40cfcbda..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 ffd75af209e9..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks-v2beta3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks-v2beta3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 ca54cdb00142..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json +++ /dev/null @@ -1,103 +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" - ] - }, - "BufferTask": { - "methods": [ - "buffer_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 43d3204a9f26..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec +++ /dev/null @@ -1,39 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - gem.add_dependency "grpc-google-iam-v1", "~> 1.1" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 c04c6d6cf1da..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 2710ba111326..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d4c001660376..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module 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 = Configuration.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 - - ## - # @private - # Configuration class for the google.cloud.tasks.v2beta3 package. - # - # This class contains common configuration for all services - # of the google.cloud.tasks.v2beta3 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 8c0f22315a81..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 46d78da395a7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb +++ /dev/null @@ -1,2339 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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.rpcs.buffer_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 - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @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 - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 - # {::Google::Cloud::Location::Locations::Client#list_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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates and buffers a new task without the need to explicitly define a Task - # message. The queue must have [HTTP - # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a - # custom ID, use the following format and set TASK_ID to your desired ID: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - # To create the task with an automatically generated ID, use the following - # format: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - # Note: This feature is in its experimental stage. You must request access to - # the API through the [Cloud Tasks BufferTask Experiment Signup - # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - # - # @overload buffer_task(request, options = nil) - # Pass arguments to `buffer_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload buffer_task(queue: nil, task_id: nil, body: nil) - # Pass arguments to `buffer_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 queue [::String] - # Required. The parent queue name. For example: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task_id [::String] - # Optional. Task ID for the task being created. If not provided, a random - # task ID is assigned to the task. - # @param body [::Google::Api::HttpBody, ::Hash] - # Optional. Body of the HTTP request. - # - # The body can take any generic value. The value is written to the - # [HttpRequest][payload] of the [Task]. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] - # - # @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::BufferTaskRequest.new - # - # # Call the buffer_task method. - # result = client.buffer_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse. - # p result - # - def buffer_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.buffer_task.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.queue - header_params["queue"] = request.queue - end - if request.task_id - header_params["task_id"] = request.task_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.buffer_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.buffer_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :buffer_task, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 - ## - # RPC-specific configuration for `buffer_task` - # @return [::Gapic::Config::Method] - # - attr_reader :buffer_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 - buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task - @buffer_task = ::Gapic::Config::Method.new buffer_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 09b2ed201bb1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3be982151f96..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 629eec886905..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8dd8dc734b6d..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb +++ /dev/null @@ -1,2199 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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.rpcs.buffer_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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - end - - @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 - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # {::Google::Cloud::Location::Locations::Rest::Client#list_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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates and buffers a new task without the need to explicitly define a Task - # message. The queue must have [HTTP - # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a - # custom ID, use the following format and set TASK_ID to your desired ID: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - # To create the task with an automatically generated ID, use the following - # format: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - # Note: This feature is in its experimental stage. You must request access to - # the API through the [Cloud Tasks BufferTask Experiment Signup - # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - # - # @overload buffer_task(request, options = nil) - # Pass arguments to `buffer_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload buffer_task(queue: nil, task_id: nil, body: nil) - # Pass arguments to `buffer_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 queue [::String] - # Required. The parent queue name. For example: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task_id [::String] - # Optional. Task ID for the task being created. If not provided, a random - # task ID is assigned to the task. - # @param body [::Google::Api::HttpBody, ::Hash] - # Optional. Body of the HTTP request. - # - # The body can take any generic value. The value is written to the - # [HttpRequest][payload] of the [Task]. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] - # - # @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::BufferTaskRequest.new - # - # # Call the buffer_task method. - # result = client.buffer_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse. - # p result - # - def buffer_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.buffer_task.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.buffer_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.buffer_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.buffer_task request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 - ## - # RPC-specific configuration for `buffer_task` - # @return [::Gapic::Config::Method] - # - attr_reader :buffer_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 - buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task - @buffer_task = ::Gapic::Config::Method.new buffer_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 0c6d67767994..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb +++ /dev/null @@ -1,1075 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the buffer_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings 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::BufferTaskResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse] - # A result object deserialized from the server's reply - def buffer_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_buffer_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 - - ## - # @private - # - # GRPC transcoding helper method for the buffer_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_buffer_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{queue}/tasks/{task_id}:buffer", - body: "*", - matches: [ - ["queue", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false], - ["task_id", %r{^[^/]+/?$}, 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 4a1b39ed83cc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +++ /dev/null @@ -1,74 +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/httpbody_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/httpbody.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.View\"\x89\x01\n\x11\x42ufferTaskRequest\x12\x35\n\x05queue\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x14\n\x07task_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\'\n\x04\x62ody\x18\x03 \x01(\x0b\x32\x14.google.api.HttpBodyB\x03\xe0\x41\x01\"D\n\x12\x42ufferTaskResponse\x12.\n\x04task\x18\x01 \x01(\x0b\x32 .google.cloud.tasks.v2beta3.Task2\xfc\x17\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta3.ListQueuesRequest\x1a..google.cloud.tasks.v2beta3.ListQueuesResponse\"@\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{parent=projects/*/locations/*}/queues\xda\x41\x06parent\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta3.GetQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\">\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta3.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"M\x82\xd3\xe4\x93\x02\x38\"//v2beta3/{parent=projects/*/locations/*}/queues:\x05queue\xda\x41\x0cparent,queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta3.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"X\x82\xd3\xe4\x93\x02>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:\x05queue\xda\x41\x11queue,update_mask\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta3.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\x82\xd3\xe4\x93\x02\x31*//v2beta3/{name=projects/*/locations/*/queues/*}\xda\x41\x04name\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta3.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:purge:\x01*\xda\x41\x04name\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta3.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:pause:\x01*\xda\x41\x04name\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta3.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"H\x82\xd3\xe4\x93\x02;\"6/v2beta3/{name=projects/*/locations/*/queues/*}:resume:\x01*\xda\x41\x04name\x12\xa1\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"V\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\x82\xd3\xe4\x93\x02K\"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta3.ListTasksRequest\x1a-.google.cloud.tasks.v2beta3.ListTasksResponse\"H\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks\xda\x41\x06parent\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta3.GetTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"F\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta3.CreateTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"P\x82\xd3\xe4\x93\x02<\"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\xda\x41\x0bparent,task\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta3.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\x82\xd3\xe4\x93\x02\x39*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\xda\x41\x04name\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta3.RunTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"M\x82\xd3\xe4\x93\x02@\";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\xda\x41\x04name\x12\xd4\x01\n\nBufferTask\x12-.google.cloud.tasks.v2beta3.BufferTaskRequest\x1a..google.cloud.tasks.v2beta3.BufferTaskResponse\"g\x82\xd3\xe4\x93\x02L\"G/v2beta3/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer:\x01*\xda\x41\x12queue,task_id,body\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 => e - # 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"], - ["google.api.HttpBody", "google/api/httpbody.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 - BufferTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.BufferTaskRequest").msgclass - BufferTaskResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.BufferTaskResponse").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 4e5bc3cc006b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +++ /dev/null @@ -1,220 +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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 - # Creates and buffers a new task without the need to explicitly define a Task - # message. The queue must have [HTTP - # target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a - # custom ID, use the following format and set TASK_ID to your desired ID: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer - # To create the task with an automatically generated ID, use the following - # format: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. - # Note: This feature is in its experimental stage. You must request access to - # the API through the [Cloud Tasks BufferTask Experiment Signup - # form](https://forms.gle/X8Zr5hiXH5tTGFqh8). - rpc :BufferTask, ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse - 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 ab6159c90b47..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 => e - # 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 179741504e5b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0e1351992ea7..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 => e - # 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 cfec4c7e04f2..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 => e - # 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 be2310f24f9a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/httpbody.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/httpbody.rb deleted file mode 100644 index 79b20abe20f9..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/httpbody.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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-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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 fe0e70e3f20f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb +++ /dev/null @@ -1,429 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Location::Locations::Client#list_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 - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task BufferTask}. - # @!attribute [rw] queue - # @return [::String] - # Required. The parent queue name. For example: - # projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @!attribute [rw] task_id - # @return [::String] - # Optional. Task ID for the task being created. If not provided, a random - # task ID is assigned to the task. - # @!attribute [rw] body - # @return [::Google::Api::HttpBody] - # Optional. Body of the HTTP request. - # - # The body can take any generic value. The value is written to the - # [HttpRequest][payload] of the [Task]. - class BufferTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task BufferTask}. - # @!attribute [rw] task - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # The created task. - class BufferTaskResponse - 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 85d176202142..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # {::Google::Cloud::Location::Locations::Client#list_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 02dfd7b1c554..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb +++ /dev/null @@ -1,720 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task 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. - # @!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. - 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. - # @!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. - 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 dc5233a886b0..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - # {::Google::Cloud::Location::Locations::Client#list_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. - # @!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. - # @!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}. - # @!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 3729ce6dfaa5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d762967fa7ec..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 a916fb4322c7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # {::Google::Iam::V1::Binding#members 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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 41c8c3a565cc..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 9daa48b735df..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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/buffer_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb deleted file mode 100644 index c2f6fd7a7f7a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/buffer_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the buffer_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#buffer_task. -# -def buffer_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::BufferTaskRequest.new - - # Call the buffer_task method. - result = client.buffer_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync] 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 d1d7e22e0da6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 754a1162ccae..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6ffc704edcf6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 765b069dc126..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0abc16d05346..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fe7dbfe3e743..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4dc7e260ce26..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 2b9fb656a9f8..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 82cf271f468c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c67e18bfdbba..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d921625937fa..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c099e253980a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 538226b9cdb4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 885e49d82cab..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 74515e24f3ba..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b26ea7bbc137..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 f77d5c1953f3..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json +++ /dev/null @@ -1,695 +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" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_BufferTask_sync", - "title": "Snippet for the buffer_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task.", - "file": "cloud_tasks/buffer_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "buffer_task", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#buffer_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::BufferTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::BufferTaskResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "BufferTask", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.BufferTask", - "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 3ea039b3e729..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tasks/v2beta3/cloud_tasks" - -class ::Google::Cloud::Tasks::V2beta3::CloudTasks::ClientPathsTest < Minitest::Test - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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 0c6daa1e3b07..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb +++ /dev/null @@ -1,1020 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_buffer_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - queue = "hello world" - task_id = "hello world" - body = {} - - buffer_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_buffer_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.buffer_task queue: queue, task_id: task_id, body: body do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.buffer_task ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.buffer_task({ queue: queue, task_id: task_id, body: body }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.buffer_task(::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, buffer_task_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil 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 fe14fe37bcf1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb +++ /dev/null @@ -1,1103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tasks/v2beta3/cloudtasks_pb" -require "google/cloud/tasks/v2beta3/cloudtasks_services_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) - - yield @response, @operation if block_given? - - @response - 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_buffer_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::BufferTaskResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - task_id = "hello world" - body = {} - - buffer_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :buffer_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, request - assert_equal "hello world", request["queue"] - assert_equal "hello world", request["task_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::HttpBody), request["body"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, buffer_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.buffer_task({ queue: queue, task_id: task_id, body: body }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.buffer_task queue: queue, task_id: task_id, body: body do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.buffer_task ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.buffer_task({ queue: queue, task_id: task_id, body: body }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.buffer_task(::Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new(queue: queue, task_id: task_id, body: body), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, buffer_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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.yardopts b/owl-bot-staging/google-cloud-tasks/.yardopts deleted file mode 100644 index ff82723ba810..000000000000 --- a/owl-bot-staging/google-cloud-tasks/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Tasks 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-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 05f79e744816..000000000000 --- a/owl-bot-staging/google-cloud-tasks/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-tasks-v2", path: "../google-cloud-tasks-v2" -gem "google-cloud-tasks-v2beta2", path: "../google-cloud-tasks-v2beta2" -gem "google-cloud-tasks-v2beta3", path: "../google-cloud-tasks-v2beta3" 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 2f2123375fe0..000000000000 --- a/owl-bot-staging/google-cloud-tasks/README.md +++ /dev/null @@ -1,114 +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 -verisoned 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), -[google-cloud-tasks-v2beta2](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta2/latest), -[google-cloud-tasks-v2beta3](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta3/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. {file:AUTHENTICATION.md Set up authentication.} - -## Migrating from 1.x versions - -The 2.0 release of the google-cloud-tasks 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. - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 67e85d3ec20c..000000000000 --- a/owl-bot-staging/google-cloud-tasks/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tasks" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 61278f522aa2..000000000000 --- a/owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec +++ /dev/null @@ -1,38 +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", "MIGRATING.md"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-tasks-v2", ">= 0.7", "< 2.a" - gem.add_dependency "google-cloud-tasks-v2beta2", ">= 0.8", "< 2.a" - gem.add_dependency "google-cloud-tasks-v2beta3", ">= 0.9", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -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 26bf69b03682..000000000000 --- a/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 3a39646627af..000000000000 --- a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require 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, "cloudtasks.googleapis.com", 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 -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. - # - # ## 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 - - ## - # 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 82cd81ffbc1f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d4fd34257c95..000000000000 --- a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/tasks" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Tasks::ClientConstructionMinitest < Minitest::Test - def test_cloud_tasks_grpc - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 f400c870a80c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-tasks/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 3eaaa7ba8111..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 5G deployment and management of cloud infrastructure and 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 f2f63b8a4215..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Telco Automation V1 API - -APIs to automate 5G deployment and management of cloud infrastructure and network functions. - -APIs to automate 5G deployment and management of cloud infrastructure and 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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 a088dd83277c..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-telco_automation-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-telco_automation-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 8913187de737..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec +++ /dev/null @@ -1,38 +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 5G deployment and management of cloud infrastructure and 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 5G deployment and management of cloud infrastructure and 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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 870ae2d9acd1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 63b133aa7d88..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 66adf7f5e0d4..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module 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 = Configuration.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 - - ## - # @private - # Configuration class for the google.cloud.telcoautomation.v1 package. - # - # This class contains common configuration for all services - # of the google.cloud.telcoautomation.v1 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 aace0c81ea10..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 68362ce47808..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 dc3c80ff5ef2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb +++ /dev/null @@ -1,3971 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - - @location_client = Google::Cloud::Location::Locations::Client.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 - ) - 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 - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 df7ded3da42b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1b42070343c9..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb +++ /dev/null @@ -1,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module TelcoAutomation - module V1 - module TelcoAutomation - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 5b7e6c590923..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 7ae54635310e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 39bd66d075df..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb +++ /dev/null @@ -1,3699 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - 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 - ) - 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 - - # 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 [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse] - # - # @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 and x-goog-user-project headers - call_metadata[:"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-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| - yield result, operation if block_given? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse] - # - # @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 and x-goog-user-project headers - call_metadata[:"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-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| - yield result, operation if block_given? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 6fcf2afc3b57..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb +++ /dev/null @@ -1,895 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module TelcoAutomation - module V1 - module TelcoAutomation - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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 694f33353e2d..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,2200 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 036b959d4b98..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 f407f2fca306..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*\x9b\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*o\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\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\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/orchestrationClusters\xda\x41\x06parent\x12\xdb\x01\n\x17GetOrchestrationCluster\x12?.google.cloud.telcoautomation.v1.GetOrchestrationClusterRequest\x1a\x35.google.cloud.telcoautomation.v1.OrchestrationCluster\"H\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/orchestrationClusters/*}\xda\x41\x04name\x12\xbe\x02\n\x1a\x43reateOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.CreateOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\x82\xd3\xe4\x93\x02R\"9/v1/{parent=projects/*/locations/*}/orchestrationClusters:\x15orchestration_cluster\xda\x41\x35parent,orchestration_cluster,orchestration_cluster_id\xca\x41)\n\x14OrchestrationCluster\x12\x11OperationMetadata\x12\xf6\x01\n\x1a\x44\x65leteOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.DeleteOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"u\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/orchestrationClusters/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xba\x01\n\x0cListEdgeSlms\x12\x34.google.cloud.telcoautomation.v1.ListEdgeSlmsRequest\x1a\x35.google.cloud.telcoautomation.v1.ListEdgeSlmsResponse\"=\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/edgeSlms\xda\x41\x06parent\x12\xa7\x01\n\nGetEdgeSlm\x12\x32.google.cloud.telcoautomation.v1.GetEdgeSlmRequest\x1a(.google.cloud.telcoautomation.v1.EdgeSlm\";\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/edgeSlms/*}\xda\x41\x04name\x12\xe2\x01\n\rCreateEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.CreateEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"{\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/edgeSlms:\x08\x65\x64ge_slm\xda\x41\x1bparent,edge_slm,edge_slm_id\xca\x41\x1c\n\x07\x45\x64geSlm\x12\x11OperationMetadata\x12\xcf\x01\n\rDeleteEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.DeleteEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"h\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/edgeSlms/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xf1\x01\n\x0f\x43reateBlueprint\x12\x37.google.cloud.telcoautomation.v1.CreateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"y\x82\xd3\xe4\x93\x02S\"F/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:\tblueprint\xda\x41\x1dparent,blueprint,blueprint_id\x12\xf3\x01\n\x0fUpdateBlueprint\x12\x37.google.cloud.telcoautomation.v1.UpdateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"{\x82\xd3\xe4\x93\x02]2P/v1/{blueprint.name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:\tblueprint\xda\x41\x15\x62lueprint,update_mask\x12\xc7\x01\n\x0cGetBlueprint\x12\x34.google.cloud.telcoautomation.v1.GetBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"U\x82\xd3\xe4\x93\x02H\x12\x46/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\xda\x41\x04name\x12\xb9\x01\n\x0f\x44\x65leteBlueprint\x12\x37.google.cloud.telcoautomation.v1.DeleteBlueprintRequest\x1a\x16.google.protobuf.Empty\"U\x82\xd3\xe4\x93\x02H*F/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\xda\x41\x04name\x12\xda\x01\n\x0eListBlueprints\x12\x36.google.cloud.telcoautomation.v1.ListBlueprintsRequest\x1a\x37.google.cloud.telcoautomation.v1.ListBlueprintsResponse\"W\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints\xda\x41\x06parent\x12\xda\x01\n\x10\x41pproveBlueprint\x12\x38.google.cloud.telcoautomation.v1.ApproveBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:approve:\x01*\xda\x41\x04name\x12\xda\x01\n\x10ProposeBlueprint\x12\x38.google.cloud.telcoautomation.v1.ProposeBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:propose:\x01*\xda\x41\x04name\x12\xd7\x01\n\x0fRejectBlueprint\x12\x37.google.cloud.telcoautomation.v1.RejectBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"_\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:reject:\x01*\xda\x41\x04name\x12\xfe\x01\n\x16ListBlueprintRevisions\x12>.google.cloud.telcoautomation.v1.ListBlueprintRevisionsRequest\x1a?.google.cloud.telcoautomation.v1.ListBlueprintRevisionsResponse\"c\x82\xd3\xe4\x93\x02V\x12T/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:listRevisions\xda\x41\x04name\x12\x8e\x02\n\x18SearchBlueprintRevisions\x12@.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsRequest\x1a\x41.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsResponse\"m\x82\xd3\xe4\x93\x02X\x12V/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:searchRevisions\xda\x41\x0cparent,query\x12\x92\x02\n\x19SearchDeploymentRevisions\x12\x41.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsRequest\x1a\x42.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsResponse\"n\x82\xd3\xe4\x93\x02Y\x12W/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:searchRevisions\xda\x41\x0cparent,query\x12\xfe\x01\n\x17\x44iscardBlueprintChanges\x12?.google.cloud.telcoautomation.v1.DiscardBlueprintChangesRequest\x1a@.google.cloud.telcoautomation.v1.DiscardBlueprintChangesResponse\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:discard:\x01*\xda\x41\x04name\x12\xda\x01\n\x14ListPublicBlueprints\x12<.google.cloud.telcoautomation.v1.ListPublicBlueprintsRequest\x1a=.google.cloud.telcoautomation.v1.ListPublicBlueprintsResponse\"E\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/publicBlueprints\xda\x41\x06parent\x12\xc7\x01\n\x12GetPublicBlueprint\x12:.google.cloud.telcoautomation.v1.GetPublicBlueprintRequest\x1a\x30.google.cloud.telcoautomation.v1.PublicBlueprint\"C\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/publicBlueprints/*}\xda\x41\x04name\x12\xf8\x01\n\x10\x43reateDeployment\x12\x38.google.cloud.telcoautomation.v1.CreateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"}\x82\xd3\xe4\x93\x02U\"G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:\ndeployment\xda\x41\x1fparent,deployment,deployment_id\x12\xfa\x01\n\x10UpdateDeployment\x12\x38.google.cloud.telcoautomation.v1.UpdateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"\x7f\x82\xd3\xe4\x93\x02`2R/v1/{deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:\ndeployment\xda\x41\x16\x64\x65ployment,update_mask\x12\xcb\x01\n\rGetDeployment\x12\x35.google.cloud.telcoautomation.v1.GetDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"V\x82\xd3\xe4\x93\x02I\x12G/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}\xda\x41\x04name\x12\xc6\x01\n\x10RemoveDeployment\x12\x38.google.cloud.telcoautomation.v1.RemoveDeploymentRequest\x1a\x16.google.protobuf.Empty\"`\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:remove:\x01*\xda\x41\x04name\x12\xde\x01\n\x0fListDeployments\x12\x37.google.cloud.telcoautomation.v1.ListDeploymentsRequest\x1a\x38.google.cloud.telcoautomation.v1.ListDeploymentsResponse\"X\x82\xd3\xe4\x93\x02I\x12G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments\xda\x41\x06parent\x12\x82\x02\n\x17ListDeploymentRevisions\x12?.google.cloud.telcoautomation.v1.ListDeploymentRevisionsRequest\x1a@.google.cloud.telcoautomation.v1.ListDeploymentRevisionsResponse\"d\x82\xd3\xe4\x93\x02W\x12U/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:listRevisions\xda\x41\x04name\x12\x82\x02\n\x18\x44iscardDeploymentChanges\x12@.google.cloud.telcoautomation.v1.DiscardDeploymentChangesRequest\x1a\x41.google.cloud.telcoautomation.v1.DiscardDeploymentChangesResponse\"a\x82\xd3\xe4\x93\x02T\"O/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:discard:\x01*\xda\x41\x04name\x12\xd8\x01\n\x0f\x41pplyDeployment\x12\x37.google.cloud.telcoautomation.v1.ApplyDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"_\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:apply:\x01*\xda\x41\x04name\x12\x8c\x02\n\x17\x43omputeDeploymentStatus\x12?.google.cloud.telcoautomation.v1.ComputeDeploymentStatusRequest\x1a@.google.cloud.telcoautomation.v1.ComputeDeploymentStatusResponse\"n\x82\xd3\xe4\x93\x02\x61\x12_/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:computeDeploymentStatus\xda\x41\x04name\x12\xed\x01\n\x12RollbackDeployment\x12:.google.cloud.telcoautomation.v1.RollbackDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"n\x82\xd3\xe4\x93\x02U\"P/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:rollback:\x01*\xda\x41\x10name,revision_id\x12\xf9\x01\n\x15GetHydratedDeployment\x12=.google.cloud.telcoautomation.v1.GetHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"l\x82\xd3\xe4\x93\x02_\x12]/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}\xda\x41\x04name\x12\x8c\x02\n\x17ListHydratedDeployments\x12?.google.cloud.telcoautomation.v1.ListHydratedDeploymentsRequest\x1a@.google.cloud.telcoautomation.v1.ListHydratedDeploymentsResponse\"n\x82\xd3\xe4\x93\x02_\x12]/v1/{parent=projects/*/locations/*/orchestrationClusters/*/deployments/*}/hydratedDeployments\xda\x41\x06parent\x12\xc5\x02\n\x18UpdateHydratedDeployment\x12@.google.cloud.telcoautomation.v1.UpdateHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"\xb1\x01\x82\xd3\xe4\x93\x02\x88\x01\x32q/v1/{hydrated_deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:\x13hydrated_deployment\xda\x41\x1fhydrated_deployment,update_mask\x12\x86\x02\n\x17\x41pplyHydratedDeployment\x12?.google.cloud.telcoautomation.v1.ApplyHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"u\x82\xd3\xe4\x93\x02h\"c/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:apply:\x01*\xda\x41\x04name\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 => e - # 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 aeb5a0efe70c..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 90056f14f6b4..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb +++ /dev/null @@ -1,1534 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!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 - # @!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. - 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 - 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 - 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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 9cadb40237a1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 f5d801f26d22..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 e620b8a5ca64..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 59cea929e21f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 837fe06cf6df..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 36b67c4d8b6e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6f1dcd6dbe78..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 12d2dc194b71..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 35705f9966f4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ae9e64e76044..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b208c428f6c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 196fa69fdfff..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 864da2271be7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6ef0069af64d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3255d8db3a9d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6af1f86663cf..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9f77c00cdad4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4909ce6d6196..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 415ed948243a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 73a7f2a58fac..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c180db653ff3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c035226f03c6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 df092d40eac6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a97004f9649d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8a982f2cc617..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fb100b88860f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fbab43d8d357..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 dd383c398357..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b99e110e5360..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d446f9773e2c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6a2cd8035935..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fa0f8aea1ea2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 428fc15287ac..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a21f8914c937..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 85a86a70134d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 496bcdd78c57..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 72b784f02873..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c07ec351fca1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 bdc02b3be5b3..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/telco_automation/v1/telco_automation" - -class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::ClientPathsTest < Minitest::Test - def test_blueprint_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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, nil 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, nil 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, nil 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 6cd32d5d1e2f..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb +++ /dev/null @@ -1,2072 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 703b7e21472d..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb +++ /dev/null @@ -1,2330 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 d4bd6fbbb508..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 5G deployment and management of cloud infrastructure and 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/.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 cbc274ad2142..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-telco_automation-v1", path: "../google-cloud-telco_automation-v1" 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 2e92a4ecc21a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# Ruby Client for the Telco Automation API - -APIs to automate 5G deployment and management of cloud infrastructure and network functions. - -APIs to automate 5G deployment and management of cloud infrastructure and 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 -verisoned 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. {file:AUTHENTICATION.md Set up authentication.} - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 e0ff9d1a9efc..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-telco_automation" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-telco_automation" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 0145d48cd76c..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec +++ /dev/null @@ -1,36 +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 5G deployment and management of cloud infrastructure and network functions." - gem.summary = "APIs to automate 5G deployment and management of cloud infrastructure and 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 = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-telco_automation-v1", ">= 0.0", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -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 17636686bd98..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b2d0d5f6d753..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require 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, "telcoautomation.googleapis.com", 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 -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. - # - # ## 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 - - ## - # 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 8d1cb6d1314a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 3a3fec9698e7..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/telco_automation" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::TelcoAutomation::ClientConstructionMinitest < Minitest::Test - def test_telco_automation_grpc - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 178450097577..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 d2f418dd31fe..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 1d8dd613e865..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-text_to_speech-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-text_to_speech-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 10c871bc9e1a..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json +++ /dev/null @@ -1,42 +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" - ] - } - } - } - } - }, - "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 e0eea98306cf..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 a17501aa0570..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 905a5ab8487c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1a99e3a31c46..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 2668f4955469..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 72abc7d8b4c7..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,514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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) - # 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. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 - - # @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 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 7e50c200d553..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3f4276a724ab..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 85ac39b7c178..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 48ae0bfbaeb7..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,490 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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) - # 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 9186dfdee93b..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,175 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 4a3156429e97..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8781232d9438..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,457 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations] - # - attr_reader :operations_client - - # 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. - # While Long Audio is in preview, SSML is temporarily unsupported. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 60f55f93ef3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 564fd50a52f1..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,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 c6558acdaae7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d70a418c1fc0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 bcd386b1cf69..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,424 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Operations] - # - attr_reader :operations_client - - # 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. - # While Long Audio is in preview, SSML is temporarily unsupported. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 d2d9e1692b5e..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,895 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/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 50e05465d07d..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,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the 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 b1143d02fb32..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 0b3e8d852278..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\x82\xd3\xe4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\xca\x41t\n8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x12\x38google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf2\x01\n com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xf8\x01\x01\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 => e - # 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 6e6f23a1800d..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 4d8d148fbce7..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb +++ /dev/null @@ -1,58 +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\"\xe9\x01\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\"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xcb\x01\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\"\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\"1\n\x18SynthesizeSpeechResponse\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*i\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\x32\xb4\x03\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\xda\x41\rlanguage_code\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\x82\xd3\xe4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb8\x02\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xf8\x01\x01\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 => e - # 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 - SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechRequest").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 - SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechResponse").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 3b479bd247ac..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb +++ /dev/null @@ -1,48 +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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 - 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 442a0e00518f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb +++ /dev/null @@ -1,278 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - - # 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. - class SynthesizeSpeechRequest - 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. - # @!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). - 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 not set, the service will choose a - # voice based on the other parameters such as language_code and gender. - # @!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. - 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, 4.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 > 4.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 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 - - # 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. 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 will be 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 - 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 e3563f0aa863..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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. - # While Long Audio is in preview, SSML is temporarily unsupported. - # @!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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 e3a5c4645415..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 c4d062c85eea..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json +++ /dev/null @@ -1,135 +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_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 7d25127802eb..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/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 e004d3c243cf..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 aaae62c36f77..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 75966e0dc15a..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,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 1abf498bb6ea..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,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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 0fe953f7caf9..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,140 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 c30defc211be..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,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 cd74d491e276..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,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/text_to_speech/v1/text_to_speech" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::ClientPathsTest < Minitest::Test - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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 eb6433db262f..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,192 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 = {} - - synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 - Gapic::Rest::ClientStub.stub :new, nil 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 c54ca42d9a65..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,187 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/texttospeech/v1/cloud_tts_pb" -require "google/cloud/texttospeech/v1/cloud_tts_services_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) - - yield @response, @operation if block_given? - - @response - 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 = {} - - 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"] - 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 }) 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 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) 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 }, 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), 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_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 f3124466a2c6..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 e091eb471668..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-text_to_speech-v1beta1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-text_to_speech-v1beta1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 819778e7dde0..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,42 +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" - ] - } - } - } - } - }, - "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 fc8dc5fa7fe9..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 4dc026d78956..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 a99aa6541077..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b50cdc6bd864..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 db51e21b6a19..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 fb3ff0baea01..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,516 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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) - # 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. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 - - # @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 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 30051f69de2a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 da5a1648dd3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 7355d7bcebab..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 47cd4ce0c63f..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,492 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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) - # 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 d754a77e757c..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,175 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 4bc55714f7f7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 643949b5f7c4..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,457 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations] - # - attr_reader :operations_client - - # 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. - # While Long Audio is in preview, SSML is temporarily unsupported. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 e35774b8d369..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 466187cd7cdd..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,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 825ae0d97a58..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 467308bd67e5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7a764257f4d4..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,424 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Operations] - # - attr_reader :operations_client - - # 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. - # While Long Audio is in preview, SSML is temporarily unsupported. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 6429eaeffc13..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,895 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/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 864ec6ecb4e1..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,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the 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 1ae30d965fd6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 0729a0017edc..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\x82\xd3\xe4\x93\x02\x41\" e - # 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.v1beta1.SynthesisInput", "google/cloud/texttospeech/v1beta1/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 V1beta1 - SynthesizeLongAudioRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeLongAudioRequest").msgclass - SynthesizeLongAudioResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeLongAudioResponse").msgclass - SynthesizeLongAudioMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeLongAudioMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb deleted file mode 100644 index 123f96e1143a..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/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/v1beta1/cloud_tts_lrs.proto for package 'Google.Cloud.TextToSpeech.V1beta1' -# Original file comments: -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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_lrs_pb' - -module Google - module Cloud - module TextToSpeech - module V1beta1 - 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.v1beta1.TextToSpeechLongAudioSynthesize' - - # Synthesizes long form text asynchronously. - rpc :SynthesizeLongAudio, ::Google::Cloud::TextToSpeech::V1beta1::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-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb deleted file mode 100644 index c6408b1ae715..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/texttospeech/v1beta1/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 = "\n1google/cloud/texttospeech/v1beta1/cloud_tts.proto\x12!google.cloud.texttospeech.v1beta1\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\"N\n\x12ListVoicesResponse\x12\x38\n\x06voices\x18\x01 \x03(\x0b\x32(.google.cloud.texttospeech.v1beta1.Voice\"\x99\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\xa0\x03\n\x17SynthesizeSpeechRequest\x12\x45\n\x05input\x18\x01 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInputB\x03\xe0\x41\x02\x12K\n\x05voice\x18\x02 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12I\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfigB\x03\xe0\x41\x02\x12\x66\n\x14\x65nable_time_pointing\x18\x04 \x03(\x0e\x32H.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType\">\n\rTimepointType\x12\x1e\n\x1aTIMEPOINT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSSML_MARK\x10\x01\"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source\"\xd5\x01\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\"\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\"\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*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*z\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\x32\xd2\x03\n\x0cTextToSpeech\x12\xa2\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse\"\'\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\xda\x41\rlanguage_code\x12\xcb\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse\">\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd1\x02\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZIcloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb\xf8\x01\x01\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 => e - # 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 - 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 - 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 - 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 - 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 2f8d8b2ccd20..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb +++ /dev/null @@ -1,48 +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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 - 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 1f5ab7536c45..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb +++ /dev/null @@ -1,313 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - - # 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. - 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 - - # 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. - # @!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). - 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 not set, the service will choose a - # voice based on the other parameters such as language_code and gender. - # @!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. - 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, 4.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 > 4.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 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 - - # 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. 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 will be 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 - 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 86f8698ef51f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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. - # While Long Audio is in preview, SSML is temporarily unsupported. - # @!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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 788888bfdb64..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 1c1d19d88767..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ /dev/null @@ -1,135 +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_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 6d83265d8012..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/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 8508d861767e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 729b57610f24..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 307a7fc4c3ed..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,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 1fa4baf2476b..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,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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 9cc63bcb9ced..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,140 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 49fdf5d63b5f..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,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 75c8133b1161..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,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/text_to_speech/v1beta1/text_to_speech" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::ClientPathsTest < Minitest::Test - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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 2ba589c20209..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,193 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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] - - synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) 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 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) 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 }, 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), 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 - Gapic::Rest::ClientStub.stub :new, nil 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 e795c4cf0ba4..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,189 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/texttospeech/v1beta1/cloud_tts_pb" -require "google/cloud/texttospeech/v1beta1/cloud_tts_services_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) - - yield @response, @operation if block_given? - - @response - 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] - - 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"] - 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 }) 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 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) 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 }, 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), 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_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.yardopts b/owl-bot-staging/google-cloud-text_to_speech/.yardopts deleted file mode 100644 index a1c2cb53fc73..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Text-to-Speech 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-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 2bef4c98b339..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-text_to_speech-v1", path: "../google-cloud-text_to_speech-v1" -gem "google-cloud-text_to_speech-v1beta1", path: "../google-cloud-text_to_speech-v1beta1" 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 037c8d83c362..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/README.md +++ /dev/null @@ -1,113 +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 -verisoned 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), -[google-cloud-text_to_speech-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/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. {file:AUTHENTICATION.md Set up authentication.} - -## Migrating from 0.x versions - -The 1.0 release of the google-cloud-text_to_speech 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. - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 256a4a4d2a10..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-text_to_speech" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-text_to_speech" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 096420e42870..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec +++ /dev/null @@ -1,37 +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", "MIGRATING.md"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-text_to_speech-v1", ">= 0.9", "< 2.a" - gem.add_dependency "google-cloud-text_to_speech-v1beta1", ">= 0.10", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -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 c474a526b1ea..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6b1e9a46251c..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb +++ /dev/null @@ -1,153 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# 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, "texttospeech.googleapis.com", 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 -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. - # - # ## 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 - - ## - # 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. - # - # ## 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 - - ## - # 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 25315388331b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 1f67eac7b095..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/text_to_speech" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::TextToSpeech::ClientConstructionMinitest < Minitest::Test - def test_text_to_speech_grpc - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 e7f15e3549ae..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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/.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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 695ba0d86029..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 af937a791684..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tpu-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tpu-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 73831c0c6e39..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec +++ /dev/null @@ -1,38 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 b72d6fc095cf..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 d636b51e49d9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 e9be05b2c709..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\"\xb4\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\"\xe1\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\"\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\":\x82\xd3\xe4\x93\x02+\x12)/v1/{parent=projects/*/locations/*}/nodes\xda\x41\x06parent\x12\x83\x01\n\x07GetNode\x12#.google.cloud.tpu.v1.GetNodeRequest\x1a\x19.google.cloud.tpu.v1.Node\"8\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/nodes/*}\xda\x41\x04name\x12\xbe\x01\n\nCreateNode\x12&.google.cloud.tpu.v1.CreateNodeRequest\x1a\x1d.google.longrunning.Operation\"i\x82\xd3\xe4\x93\x02\x31\")/v1/{parent=projects/*/locations/*}/nodes:\x04node\xda\x41\x13parent,node,node_id\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xa9\x01\n\nDeleteNode\x12&.google.cloud.tpu.v1.DeleteNodeRequest\x1a\x1d.google.longrunning.Operation\"T\x82\xd3\xe4\x93\x02+*)/v1/{name=projects/*/locations/*/nodes/*}\xda\x41\x04name\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xaf\x01\n\x0bReimageNode\x12\'.google.cloud.tpu.v1.ReimageNodeRequest\x1a\x1d.google.longrunning.Operation\"X\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/nodes/*}:reimage:\x01*\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xa6\x01\n\x08StopNode\x12$.google.cloud.tpu.v1.StopNodeRequest\x1a\x1d.google.longrunning.Operation\"U\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/nodes/*}:stop:\x01*\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xa9\x01\n\tStartNode\x12%.google.cloud.tpu.v1.StartNodeRequest\x1a\x1d.google.longrunning.Operation\"V\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/nodes/*}:start:\x01*\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x12\xca\x01\n\x16ListTensorFlowVersions\x12\x32.google.cloud.tpu.v1.ListTensorFlowVersionsRequest\x1a\x33.google.cloud.tpu.v1.ListTensorFlowVersionsResponse\"G\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*}/tensorflowVersions\xda\x41\x06parent\x12\xb7\x01\n\x14GetTensorFlowVersion\x12\x30.google.cloud.tpu.v1.GetTensorFlowVersionRequest\x1a&.google.cloud.tpu.v1.TensorFlowVersion\"E\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/tensorflowVersions/*}\xda\x41\x04name\x12\xc2\x01\n\x14ListAcceleratorTypes\x12\x30.google.cloud.tpu.v1.ListAcceleratorTypesRequest\x1a\x31.google.cloud.tpu.v1.ListAcceleratorTypesResponse\"E\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/acceleratorTypes\xda\x41\x06parent\x12\xaf\x01\n\x12GetAcceleratorType\x12..google.cloud.tpu.v1.GetAcceleratorTypeRequest\x1a$.google.cloud.tpu.v1.AcceleratorType\"C\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/acceleratorTypes/*}\xda\x41\x04name\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 => e - # 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 16c826c7ca01..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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 b71e6490b6e2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 dd226193121d..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb +++ /dev/null @@ -1,1455 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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 - - @location_client = Google::Cloud::Location::Locations::Client.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 - ) - 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 - - # 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "tpu.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 88ab6049e5f9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1ba6d3b8f603..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb +++ /dev/null @@ -1,801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Tpu - module V1 - module Tpu - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "tpu.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 774ebeced0c9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 94eeff501329..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 ee22129a995f..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb +++ /dev/null @@ -1,518 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - 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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6f3a56b59c26..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 933a39a603c9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 3028e2cb9ca7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 98a06153a32f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4029125836a9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b7d329463885..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 e00627fee3eb..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 40d999018528..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 e0571dc8f04f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5c3f92522b83..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ca051218bd12..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 203363c52013..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9842e5d6517e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 89bd8b35a1f8..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/tpu/v1/tpu" - -class ::Google::Cloud::Tpu::V1::Tpu::ClientPathsTest < Minitest::Test - def test_accelerator_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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 cb9493acc4b0..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb +++ /dev/null @@ -1,784 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-tpu/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-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 47e279d30fb4..000000000000 --- a/owl-bot-staging/google-cloud-tpu/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-tpu-v1", path: "../google-cloud-tpu-v1" 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 f98d8c6b72fa..000000000000 --- a/owl-bot-staging/google-cloud-tpu/README.md +++ /dev/null @@ -1,130 +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 -verisoned 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. {file:AUTHENTICATION.md Set up authentication.} - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 2373de8d758d..000000000000 --- a/owl-bot-staging/google-cloud-tpu/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tpu" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-tpu" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 829501d5ee68..000000000000 --- a/owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec +++ /dev/null @@ -1,36 +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 = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-tpu-v1", ">= 0.0", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -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 b5943080caea..000000000000 --- a/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 74344869b867..000000000000 --- a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require 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, "tpu.googleapis.com", 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 -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. - # - # ## 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 - - ## - # 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 4b6f0ea48ee4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 81eba210cc4c..000000000000 --- a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/tpu" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::Tpu::ClientConstructionMinitest < Minitest::Test - def test_tpu_grpc - Gapic::ServiceStub.stub :new, :stub 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 79e9c2c5fd0e..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-tpu/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 99d960906acf..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 668c237733b9..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-trace-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-trace-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 1f336f31aafc..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 702c4bfdd3f7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 1af25612cec3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a9868b44888a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 7885b1ccd020..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 2da1ecc0235e..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb +++ /dev/null @@ -1,699 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 33cb78ba9454..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 09f38056895f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 de1c13e712b3..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb +++ /dev/null @@ -1,649 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 bb45de89d482..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb +++ /dev/null @@ -1,239 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Trace::V1::ListTracesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Trace::V1::Trace.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_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 4e4559263817..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 85202166bda1..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\x82\xd3\xe4\x93\x02\"\x12 /v1/projects/{project_id}/traces\xda\x41\nproject_id\x12\xab\x01\n\x08GetTrace\x12..google.devtools.cloudtrace.v1.GetTraceRequest\x1a$.google.devtools.cloudtrace.v1.Trace\"I\x82\xd3\xe4\x93\x02-\x12+/v1/projects/{project_id}/traces/{trace_id}\xda\x41\x13project_id,trace_id\x12\x9e\x01\n\x0bPatchTraces\x12\x31.google.devtools.cloudtrace.v1.PatchTracesRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02*2 /v1/projects/{project_id}/traces:\x06traces\xda\x41\x11project_id,traces\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 => e - # 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 92b8210f762e..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 2020 Google LLC -# -# Licensed under the Apache License, Version 2.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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 05875cf63041..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 d71d3b0e06ab..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 1cbaad7daba4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a262aa822296..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 13629e305218..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 0d541ceb7f26..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb +++ /dev/null @@ -1,253 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 833f0c589a25..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb +++ /dev/null @@ -1,264 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/devtools/cloudtrace/v1/trace_pb" -require "google/devtools/cloudtrace/v1/trace_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 be4bd409a212..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 de43c042c0fd..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-trace-v2" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-trace-v2" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 17a85424605a..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 57b9d364599a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 3e0fe6afd892..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 f02efd739cad..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4fe1f4f5753d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 81ca9a91d9c4..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb +++ /dev/null @@ -1,590 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/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 - 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 - ) - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 a6d016c426a5..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a67d26c1bc75..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 fa6440cc796a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 f6761a94a971..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb +++ /dev/null @@ -1,550 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "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 - 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 - ) - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 61288170eaf3..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb +++ /dev/null @@ -1,180 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Trace::V2::Span.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 ee3315081986..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 70c5277d7d81..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 => e - # 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 ae8ec10cf311..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\"?\x82\xd3\xe4\x93\x02,\"\'/v2/{name=projects/*}/traces:batchWrite:\x01*\xda\x41\nname,spans\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 => e - # 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 2a4ecb7db4f6..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 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 730b4cbefedd..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb +++ /dev/null @@ -1,417 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!attribute [rw] message_event - # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::MessageEvent] - # An event describing a message sent/received between Spans. - 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. - # @!attribute [rw] int_value - # @return [::Integer] - # A 64-bit signed integer. - # @!attribute [rw] bool_value - # @return [::Boolean] - # A Boolean value represented by `true` or `false`. - 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 04657976a99b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 5160138862c2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 92813184036d..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 00f99ba3e105..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 8dfde6c6615c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 19a0ffe3ccd2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/trace/v2/trace_service" - -class ::Google::Cloud::Trace::V2::TraceService::ClientPathsTest < Minitest::Test - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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 d07772d16b81..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb +++ /dev/null @@ -1,204 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 deb24751ff8a..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb +++ /dev/null @@ -1,211 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/devtools/cloudtrace/v2/tracing_pb" -require "google/devtools/cloudtrace/v2/tracing_services_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) - - yield @response, @operation if block_given? - - @response - 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 - Gapic::ServiceStub.stub :new, nil 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 -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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 c5cb33c23885..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 6a2b8f7c64b0..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-translate-v3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-translate-v3" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 e4a8edee8589..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json +++ /dev/null @@ -1,118 +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" - ] - }, - "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" - ] - }, - "ListGlossaries": { - "methods": [ - "list_glossaries" - ] - }, - "GetGlossary": { - "methods": [ - "get_glossary" - ] - }, - "DeleteGlossary": { - "methods": [ - "delete_glossary" - ] - }, - "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" - ] - } - } - } - } - } - } -} 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 24133f499d21..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 c617e7ce1216..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 4266fbb6aaed..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 cc4da1504121..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb +++ /dev/null @@ -1,67 +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\"\xb2\x01\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\"5\n\x15\x41\x64\x61ptiveMtTranslation\x12\x1c\n\x0ftranslated_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\x88\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\"\xf3\x02\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:\x8a\x01\xea\x41\x86\x01\n\'translate.googleapis.com/AdaptiveMtFile\x12[projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}\"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\"\xaf\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:\xad\x01\xea\x41\xa9\x01\n+translate.googleapis.com/AdaptiveMtSentence\x12zprojects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}\"\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\xc9\x01\n\x1d\x63om.google.cloud.translate.v3B\x0f\x41\x64\x61ptiveMtProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\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 => e - # 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 - 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/common_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb deleted file mode 100644 index bb8df94f8bc7..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb +++ /dev/null @@ -1,46 +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' - - -descriptor_data = "\n&google/cloud/translate/v3/common.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.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\x42\xc5\x01\n\x1d\x63om.google.cloud.translate.v3B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\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 => e - # 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 - 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 e14236f02a4e..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/translate/v3/translation_service/rest" -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 516a79c6783c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ff4a3957f1fd..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb +++ /dev/null @@ -1,2680 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/translate/v3/translation_service_pb" - -module Google - module Cloud - module Translate - module V3 - module TranslationService - ## - # Client for the TranslationService service. - # - # Provides natural language translation operations. - # - class Client - # @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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Translate::V3::TranslationService::Operations] - # - attr_reader :operations_client - - # 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, 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. 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. - # @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`, - # - # - # 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 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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. 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. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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. - # @param target_language_codes [::Array<::String>] - # Required. Specify up to 10 language codes here. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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) - # 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. - # For now only one sentence per request is supported. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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. - # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] - # Google Cloud Storage file source. - # - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 `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 `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 `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 - - # @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 - 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 - 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 - 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 - - 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 bbc59e31d50c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 665f9fece6d5..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Translate - module V3 - module TranslationService - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a8437ea836b0..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 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 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 - - 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 3f7e5c8bd9e9..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/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/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 9f18221b0ec3..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb +++ /dev/null @@ -1,2514 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/translate/v3/translation_service_pb" -require "google/cloud/translate/v3/translation_service/rest/service_stub" - -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 - 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 - ) - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Translate::V3::TranslationService::Rest::Operations] - # - attr_reader :operations_client - - # 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, 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. 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. - # @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`, - # - # - # 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 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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. 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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. - # @param target_language_codes [::Array<::String>] - # Required. Specify up to 10 language codes here. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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) - # 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. - # For now only one sentence per request is supported. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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. - # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] - # Google Cloud Storage file source. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 `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 `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 `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 - - # @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 - 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 - 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 - 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 - - 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 f91a2c9274b0..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb +++ /dev/null @@ -1,1060 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Translate - module V3 - module TranslationService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the 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 92bd37858395..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +++ /dev/null @@ -1,1279 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::TranslateTextResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::DetectLanguageResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::SupportedLanguages.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListGlossariesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::Glossary.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtFile.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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 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 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 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 - 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 3a43ba999c0f..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb +++ /dev/null @@ -1,94 +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/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/translate/v3/adaptive_mt_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/translate/v3/translation_service.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/translate/v3/adaptive_mt.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"N\n\x1bTranslateTextGlossaryConfig\x12\x15\n\x08glossary\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xb5\x03\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\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\"\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\"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\"\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\"\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\x32\xa8&\n\x12TranslationService\x12\xd4\x02\n\rTranslateText\x12\x31.google.cloud.translation.v3.TranslateTextRequest\x1a\x32.google.cloud.translation.v3.TranslateTextResponse\"\xdb\x01\x82\xd3\xe4\x93\x02\x62\"1/v3/{parent=projects/*/locations/*}:translateText:\x01*Z*\"%/v3/{parent=projects/*}:translateText:\x01*\xda\x41$parent,target_language_code,contents\xda\x41Iparent,model,mime_type,source_language_code,target_language_code,contents\x12\x87\x02\n\x0e\x44\x65tectLanguage\x12\x32.google.cloud.translation.v3.DetectLanguageRequest\x1a\x33.google.cloud.translation.v3.DetectLanguageResponse\"\x8b\x01\x82\xd3\xe4\x93\x02\x64\"2/v3/{parent=projects/*/locations/*}:detectLanguage:\x01*Z+\"&/v3/{parent=projects/*}:detectLanguage:\x01*\xda\x41\x1eparent,model,mime_type,content\x12\x97\x02\n\x15GetSupportedLanguages\x12\x39.google.cloud.translation.v3.GetSupportedLanguagesRequest\x1a/.google.cloud.translation.v3.SupportedLanguages\"\x91\x01\x82\xd3\xe4\x93\x02\x66\x12\x36/v3/{parent=projects/*/locations/*}/supportedLanguagesZ,\x12*/v3/{parent=projects/*}/supportedLanguages\xda\x41\"parent,model,display_language_code\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\x82\xd3\xe4\x93\x02;\"6/v3/{parent=projects/*/locations/*}:batchTranslateText:\x01*\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x12\xce\x02\n\x16\x42\x61tchTranslateDocument\x12:.google.cloud.translation.v3.BatchTranslateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x01\x82\xd3\xe4\x93\x02?\":/v3/{parent=projects/*/locations/*}:batchTranslateDocument:\x01*\xda\x41Mparent,source_language_code,target_language_codes,input_configs,output_config\xca\x41@\n\x1e\x42\x61tchTranslateDocumentResponse\x12\x1e\x42\x61tchTranslateDocumentMetadata\x12\xdc\x01\n\x0e\x43reateGlossary\x12\x32.google.cloud.translation.v3.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation\"w\x82\xd3\xe4\x93\x02:\"./v3/{parent=projects/*/locations/*}/glossaries:\x08glossary\xda\x41\x0fparent,glossary\xca\x41\"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\x12\xba\x01\n\x0eListGlossaries\x12\x32.google.cloud.translation.v3.ListGlossariesRequest\x1a\x33.google.cloud.translation.v3.ListGlossariesResponse\"?\x82\xd3\xe4\x93\x02\x30\x12./v3/{parent=projects/*/locations/*}/glossaries\xda\x41\x06parent\x12\xa4\x01\n\x0bGetGlossary\x12/.google.cloud.translation.v3.GetGlossaryRequest\x1a%.google.cloud.translation.v3.Glossary\"=\x82\xd3\xe4\x93\x02\x30\x12./v3/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\x12\xd5\x01\n\x0e\x44\x65leteGlossary\x12\x32.google.cloud.translation.v3.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation\"p\x82\xd3\xe4\x93\x02\x30*./v3/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\x12\xf8\x01\n\x17\x43reateAdaptiveMtDataset\x12;.google.cloud.translation.v3.CreateAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"p\x82\xd3\xe4\x93\x02M\"6/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets:\x13\x61\x64\x61ptive_mt_dataset\xda\x41\x1aparent,adaptive_mt_dataset\x12\xb5\x01\n\x17\x44\x65leteAdaptiveMtDataset\x12;.google.cloud.translation.v3.DeleteAdaptiveMtDatasetRequest\x1a\x16.google.protobuf.Empty\"E\x82\xd3\xe4\x93\x02\x38*6/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\xda\x41\x04name\x12\xc7\x01\n\x14GetAdaptiveMtDataset\x12\x38.google.cloud.translation.v3.GetAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"E\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\xda\x41\x04name\x12\xda\x01\n\x16ListAdaptiveMtDatasets\x12:.google.cloud.translation.v3.ListAdaptiveMtDatasetsRequest\x1a;.google.cloud.translation.v3.ListAdaptiveMtDatasetsResponse\"G\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets\xda\x41\x06parent\x12\xdd\x01\n\x13\x41\x64\x61ptiveMtTranslate\x12\x37.google.cloud.translation.v3.AdaptiveMtTranslateRequest\x1a\x38.google.cloud.translation.v3.AdaptiveMtTranslateResponse\"S\x82\xd3\xe4\x93\x02<\"7/v3/{parent=projects/*/locations/*}:adaptiveMtTranslate:\x01*\xda\x41\x0eparent,content\x12\xd0\x01\n\x11GetAdaptiveMtFile\x12\x35.google.cloud.translation.v3.GetAdaptiveMtFileRequest\x1a+.google.cloud.translation.v3.AdaptiveMtFile\"W\x82\xd3\xe4\x93\x02J\x12H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\xda\x41\x04name\x12\xc1\x01\n\x14\x44\x65leteAdaptiveMtFile\x12\x38.google.cloud.translation.v3.DeleteAdaptiveMtFileRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02J*H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\xda\x41\x04name\x12\xee\x01\n\x14ImportAdaptiveMtFile\x12\x38.google.cloud.translation.v3.ImportAdaptiveMtFileRequest\x1a\x39.google.cloud.translation.v3.ImportAdaptiveMtFileResponse\"a\x82\xd3\xe4\x93\x02R\"M/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}:importAdaptiveMtFile:\x01*\xda\x41\x06parent\x12\xe3\x01\n\x13ListAdaptiveMtFiles\x12\x37.google.cloud.translation.v3.ListAdaptiveMtFilesRequest\x1a\x38.google.cloud.translation.v3.ListAdaptiveMtFilesResponse\"Y\x82\xd3\xe4\x93\x02J\x12H/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtFiles\xda\x41\x06parent\x12\xd7\x02\n\x17ListAdaptiveMtSentences\x12;.google.cloud.translation.v3.ListAdaptiveMtSentencesRequest\x1a<.google.cloud.translation.v3.ListAdaptiveMtSentencesResponse\"\xc0\x01\x82\xd3\xe4\x93\x02\xb0\x01\x12^/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}/adaptiveMtSentencesZN\x12L/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtSentences\xda\x41\x06parent\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\xd1\x01\n\x1d\x63om.google.cloud.translate.v3B\x17TranslationServiceProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xf8\x01\x01\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 => e - # 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 Translate - module V3 - TranslateTextGlossaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextGlossaryConfig").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 - 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 - 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 - 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 - 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 - 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 0f94199eb19c..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb +++ /dev/null @@ -1,104 +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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 - # 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 - # 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 - # 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 - 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 94e58eeca03f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 1f9dfae2bf4c..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb +++ /dev/null @@ -1,327 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # For now only one sentence per request is supported. - class AdaptiveMtTranslateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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. - 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. - # @!attribute [rw] gcs_input_source - # @return [::Google::Cloud::Translate::V3::GcsInputSource] - # Google Cloud Storage file source. - 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/common.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb deleted file mode 100644 index bcd5f44c03b3..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 - 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 9e2b70975b71..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb +++ /dev/null @@ -1,1439 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Translate - module V3 - # 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. - class TranslateTextGlossaryConfig - 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. 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. - # @!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`, - # - # - # 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] 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 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. - # @!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 - # @!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. 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. - # @!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. - # @!attribute [rw] target_language_codes - # @return [::Array<::String>] - # Required. Specify up to 10 language codes here. - # @!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. - # @!attribute [rw] language_codes_set - # @return [::Google::Cloud::Translate::V3::Glossary::LanguageCodesSet] - # Used with equivalent term set glossaries. - # @!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 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 - - # 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 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. - # @!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 - 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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/timestamp.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 7d5e15f02316..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 62d2551870a8..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json +++ /dev/null @@ -1,815 +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_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_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_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" - } - ] - } - ] -} \ 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 958fb7691729..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d7fbe88fa4f1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b55c207d0f3a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 980f68f1c8bc..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb deleted file mode 100644 index cc243a1da67a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/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 251110741fb7..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 894999dde9cc..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb deleted file mode 100644 index 7dcb6d46f8a9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/detect_language.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb deleted file mode 100644 index 82875356ae12..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/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 f8fab6488146..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9c57bc6ed531..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb deleted file mode 100644 index 634988a6f7b6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_supported_languages.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb deleted file mode 100644 index 13dec890a2ca..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 6dbd5d26bcd1..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/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 35a9a39e6f2a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1e4952f64dec..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 85a465c30e7b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_glossaries.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb deleted file mode 100644 index dfb31b43cb15..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/translate_document.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb deleted file mode 100644 index f1284338b62d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 ccbc5c1fa3b4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/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 2a03b67e9372..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 71e69df43596..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/translate/v3/translation_service" - -class ::Google::Cloud::Translate::V3::TranslationService::ClientPathsTest < Minitest::Test - def test_adaptive_mt_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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_glossary_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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 -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 63f5a5cc82f2..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb +++ /dev/null @@ -1,1218 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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 = {} - labels = {} - - translate_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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, 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, 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, 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, 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, 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_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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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"] - - adaptive_mt_translate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::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 }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.adaptive_mt_translate parent: parent, dataset: dataset, content: content 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) 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 }, 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), 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_configure - credentials_token = :dummy_value - - client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil 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 e974c127767f..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb +++ /dev/null @@ -1,1394 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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 = {} - 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({}, 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, 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, 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, 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, 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, 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_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_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_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"] - - 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"] - 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 }) 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 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) 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 }, 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), 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_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-translate/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-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 fe92dfe95698..000000000000 --- a/owl-bot-staging/google-cloud-translate/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-translate-v2", path: "../google-cloud-translate-v2" -gem "google-cloud-translate-v3", path: "../google-cloud-translate-v3" 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 682f96fafb2c..000000000000 --- a/owl-bot-staging/google-cloud-translate/README.md +++ /dev/null @@ -1,113 +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 -verisoned 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. {file:AUTHENTICATION.md Set up authentication.} - -## 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. - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 aa58d3c591d1..000000000000 --- a/owl-bot-staging/google-cloud-translate/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-translate" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-translate" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 d3d72ae47255..000000000000 --- a/owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec +++ /dev/null @@ -1,37 +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 = ">= 2.6" - - 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.6", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -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 bd81a7a722a7..000000000000 --- a/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 94d4c862ae88..000000000000 --- a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb +++ /dev/null @@ -1,119 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require 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, "translate.googleapis.com", 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 -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. - # - # ## 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 - - ## - # 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 cc66c8371011..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 66c8aea3e58a..000000000000 --- a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/translate" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Translate::ClientConstructionMinitest < Minitest::Test - def test_translation_service_grpc - Gapic::ServiceStub.stub :new, :stub 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 - Gapic::Rest::ClientStub.stub :new, :stub 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 d8731f6b6bd0..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-translate/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" 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 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-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 b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec 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 89fe30c6002e..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/README.md +++ /dev/null @@ -1,144 +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. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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 e1e030426e25..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-video-live_stream-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-video-live_stream-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -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 tests with coverage." - task :coverage do - 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 9fc9b3277016..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json +++ /dev/null @@ -1,128 +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" - ] - }, - "CreateInput": { - "methods": [ - "create_input" - ] - }, - "ListInputs": { - "methods": [ - "list_inputs" - ] - }, - "GetInput": { - "methods": [ - "get_input" - ] - }, - "DeleteInput": { - "methods": [ - "delete_input" - ] - }, - "UpdateInput": { - "methods": [ - "update_input" - ] - }, - "CreateEvent": { - "methods": [ - "create_event" - ] - }, - "ListEvents": { - "methods": [ - "list_events" - ] - }, - "GetEvent": { - "methods": [ - "get_event" - ] - }, - "DeleteEvent": { - "methods": [ - "delete_event" - ] - }, - "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 50386ecb7aeb..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec +++ /dev/null @@ -1,38 +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 = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -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 f8ec1f9649e9..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 d7f513f46b79..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 c5736875551c..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module 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 = Configuration.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 - - ## - # @private - # Configuration class for the google.cloud.video.livestream.v1 package. - # - # This class contains common configuration for all services - # of the google.cloud.video.livestream.v1 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end - end -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 3fe4043f2a83..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4283102afb99..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,2870 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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.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.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 - 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 - - @location_client = Google::Cloud::Location::Locations::Client.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 - ) - 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 - - # 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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: - # - # * [`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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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 and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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? - return response - 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 and x-goog-user-project headers - metadata[:"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-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? - return 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: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 `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 `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 `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 - 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 - 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 - 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 8b3fc1a2872b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 46dcf7fd4633..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,803 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Video - module LiveStream - module V1 - module LivestreamService - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -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 72d686c49a44..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,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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 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 bbfca138d68c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4fc822290964..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,2694 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/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 - 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.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.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 - 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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - config.bindings_override = @config.bindings_override - 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 - ) - 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 - - # 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse] - # - # @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 and x-goog-user-project headers - call_metadata[:"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-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| - yield result, operation if block_given? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse] - # - # @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 and x-goog-user-project headers - call_metadata[:"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-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| - yield result, operation if block_given? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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: - # - # * [`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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse] - # - # @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 and x-goog-user-project headers - call_metadata[:"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-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| - yield result, operation if block_given? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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-z0-9]`, - # could contain dashes (-) in between. - # @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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 [::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse] - # - # @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 and x-goog-user-project headers - call_metadata[:"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-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| - yield result, operation if block_given? - return 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 and x-goog-user-project headers - call_metadata[:"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-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? - return result - 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 and x-goog-user-project headers - call_metadata[:"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-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? - return 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 - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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 `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 `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 `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 - 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 - 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 - 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 4944aed5c019..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,897 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Video - module LiveStream - module V1 - module LivestreamService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @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`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"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-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/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 4d85b25229c8..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,1369 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/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 - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Channel.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the start_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the stop_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Input.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Asset.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Pool.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - 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, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_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 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 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 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 2d792edac10a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 f1f1742af325..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 e40dd8a19705..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb +++ /dev/null @@ -1,66 +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/protobuf/duration_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\x1egoogle/protobuf/duration.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\"\xbc\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\"@\n\x0cManifestType\x12\x1d\n\x19MANIFEST_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03HLS\x10\x01\x12\x08\n\x04\x44\x41SH\x10\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\"\xff\x03\n\x0bVideoStream\x12O\n\x04h264\x18\x14 \x01(\x0b\x32?.google.cloud.video.livestream.v1.VideoStream.H264CodecSettingsH\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_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\" \n\nTextStream\x12\x12\n\x05\x63odec\x18\x01 \x01(\tB\x03\xe0\x41\x02\"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 => e - # 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.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 - 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 - 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 - 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 8e179cadac36..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb +++ /dev/null @@ -1,96 +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\"\xf0\x06\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\"5\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:\\\xea\x41Y\n\x1flivestream.googleapis.com/Input\x12\x36projects/{project}/locations/{location}/inputs/{input}\"\x86\x0b\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\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\x41\n\x0b\x65ncryptions\x18\x18 \x03(\x0b\x32,.google.cloud.video.livestream.v1.Encryption\x12\x43\n\x0cinput_config\x18\x19 \x01(\x0b\x32-.google.cloud.video.livestream.v1.InputConfig\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}\"\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\"\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\"\x82\x0b\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\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-\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\"\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\"\x9d\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\xb2\x02\n\nDrmSystems\x12G\n\x08widevine\x18\x01 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.Widevine\x12G\n\x08\x66\x61irplay\x18\x02 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.Fairplay\x12I\n\tplayready\x18\x03 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.Encryption.Playready\x12G\n\x08\x63learkey\x18\x04 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.Clearkey\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\"\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 => e - # 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 - 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 - 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 - 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::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.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 - 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 f568dbff5376..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/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/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/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\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\"\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\"\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(\t2\xc2\"\n\x11LivestreamService\x12\xe0\x01\n\rCreateChannel\x12\x36.google.cloud.video.livestream.v1.CreateChannelRequest\x1a\x1d.google.longrunning.Operation\"x\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/channels:\x07\x63hannel\xda\x41\x19parent,channel,channel_id\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\x12\xbc\x01\n\x0cListChannels\x12\x35.google.cloud.video.livestream.v1.ListChannelsRequest\x1a\x36.google.cloud.video.livestream.v1.ListChannelsResponse\"=\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/channels\xda\x41\x06parent\x12\xa9\x01\n\nGetChannel\x12\x33.google.cloud.video.livestream.v1.GetChannelRequest\x1a).google.cloud.video.livestream.v1.Channel\";\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/channels/*}\xda\x41\x04name\x12\xd0\x01\n\rDeleteChannel\x12\x36.google.cloud.video.livestream.v1.DeleteChannelRequest\x1a\x1d.google.longrunning.Operation\"h\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/channels/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xe2\x01\n\rUpdateChannel\x12\x36.google.cloud.video.livestream.v1.UpdateChannelRequest\x1a\x1d.google.longrunning.Operation\"z\x82\xd3\xe4\x93\x02?24/v1/{channel.name=projects/*/locations/*/channels/*}:\x07\x63hannel\xda\x41\x13\x63hannel,update_mask\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\x12\xda\x01\n\x0cStartChannel\x12\x35.google.cloud.video.livestream.v1.StartChannelRequest\x1a\x1d.google.longrunning.Operation\"t\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/channels/*}:start:\x01*\xda\x41\x04name\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\x12\xd7\x01\n\x0bStopChannel\x12\x34.google.cloud.video.livestream.v1.StopChannelRequest\x1a\x1d.google.longrunning.Operation\"s\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/channels/*}:stop:\x01*\xda\x41\x04name\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\x12\xd2\x01\n\x0b\x43reateInput\x12\x34.google.cloud.video.livestream.v1.CreateInputRequest\x1a\x1d.google.longrunning.Operation\"n\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/inputs:\x05input\xda\x41\x15parent,input,input_id\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\x12\xb4\x01\n\nListInputs\x12\x33.google.cloud.video.livestream.v1.ListInputsRequest\x1a\x34.google.cloud.video.livestream.v1.ListInputsResponse\";\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/inputs\xda\x41\x06parent\x12\xa1\x01\n\x08GetInput\x12\x31.google.cloud.video.livestream.v1.GetInputRequest\x1a\'.google.cloud.video.livestream.v1.Input\"9\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/inputs/*}\xda\x41\x04name\x12\xca\x01\n\x0b\x44\x65leteInput\x12\x34.google.cloud.video.livestream.v1.DeleteInputRequest\x1a\x1d.google.longrunning.Operation\"f\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/inputs/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xd4\x01\n\x0bUpdateInput\x12\x34.google.cloud.video.livestream.v1.UpdateInputRequest\x1a\x1d.google.longrunning.Operation\"p\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{input.name=projects/*/locations/*/inputs/*}:\x05input\xda\x41\x11input,update_mask\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\x12\xca\x01\n\x0b\x43reateEvent\x12\x34.google.cloud.video.livestream.v1.CreateEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"\\\x82\xd3\xe4\x93\x02>\"5/v1/{parent=projects/*/locations/*/channels/*}/events:\x05\x65vent\xda\x41\x15parent,event,event_id\x12\xbf\x01\n\nListEvents\x12\x33.google.cloud.video.livestream.v1.ListEventsRequest\x1a\x34.google.cloud.video.livestream.v1.ListEventsResponse\"F\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/channels/*}/events\xda\x41\x06parent\x12\xac\x01\n\x08GetEvent\x12\x31.google.cloud.video.livestream.v1.GetEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/channels/*/events/*}\xda\x41\x04name\x12\xa1\x01\n\x0b\x44\x65leteEvent\x12\x34.google.cloud.video.livestream.v1.DeleteEventRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/channels/*/events/*}\xda\x41\x04name\x12\xd2\x01\n\x0b\x43reateAsset\x12\x34.google.cloud.video.livestream.v1.CreateAssetRequest\x1a\x1d.google.longrunning.Operation\"n\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/assets:\x05\x61sset\xda\x41\x15parent,asset,asset_id\xca\x41\x1a\n\x05\x41sset\x12\x11OperationMetadata\x12\xca\x01\n\x0b\x44\x65leteAsset\x12\x34.google.cloud.video.livestream.v1.DeleteAssetRequest\x1a\x1d.google.longrunning.Operation\"f\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/assets/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x12\xa1\x01\n\x08GetAsset\x12\x31.google.cloud.video.livestream.v1.GetAssetRequest\x1a\'.google.cloud.video.livestream.v1.Asset\"9\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/assets/*}\xda\x41\x04name\x12\xb4\x01\n\nListAssets\x12\x33.google.cloud.video.livestream.v1.ListAssetsRequest\x1a\x34.google.cloud.video.livestream.v1.ListAssetsResponse\";\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/assets\xda\x41\x06parent\x12\x9d\x01\n\x07GetPool\x12\x30.google.cloud.video.livestream.v1.GetPoolRequest\x1a&.google.cloud.video.livestream.v1.Pool\"8\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/pools/*}\xda\x41\x04name\x12\xcd\x01\n\nUpdatePool\x12\x33.google.cloud.video.livestream.v1.UpdatePoolRequest\x1a\x1d.google.longrunning.Operation\"k\x82\xd3\xe4\x93\x02\x36\x32./v1/{pool.name=projects/*/locations/*/pools/*}:\x04pool\xda\x41\x10pool,update_mask\xca\x41\x19\n\x04Pool\x12\x11OperationMetadata\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 => e - # 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 - 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 - 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 - 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 c5fe1b3ac374..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb +++ /dev/null @@ -1,97 +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 2023 Google LLC -# -# Licensed under the Apache License, Version 2.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 - # 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 - # 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 - # 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 97b34b4de8e4..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,395 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # 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. - 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 - 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. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!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: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-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 b03587481349..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/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 38b4b61e6061..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 6497ebc78dc1..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. 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 77ced902335d..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb +++ /dev/null @@ -1,509 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. - # @!attribute [rw] video_stream - # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream] - # Encoding of a video stream. - # @!attribute [rw] audio_stream - # @return [::Google::Cloud::Video::LiveStream::V1::AudioStream] - # Encoding of an audio stream. - # @!attribute [rw] text_stream - # @return [::Google::Cloud::Video::LiveStream::V1::TextStream] - # Encoding of a text stream. For example, closed captions or subtitles. - 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. - # @!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`. - # @!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. - 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 - - # 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. - 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, 1920]. - # @!attribute [rw] height_pixels - # @return [::Integer] - # Required. The height of the video in pixels. Must be an even integer. - # Valid range is [180, 1080]. - # @!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). - # @!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]. - # @!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. - # @!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 - 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` - class TextStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone e.g. "America/Los_Angeles". - 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 33cdc41a8418..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb +++ /dev/null @@ -1,813 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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. Not supported yet. - UHD = 3 - 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] 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>] - # 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}. - 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 - - # 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 - - # 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. - # @!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 - - # 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. - # @!attribute [rw] ad_break - # @return [::Google::Cloud::Video::LiveStream::V1::Event::AdBreakTask] - # Inserts a new ad opportunity. - # @!attribute [rw] return_to_program - # @return [::Google::Cloud::Video::LiveStream::V1::Event::ReturnToProgramTask] - # Stops any running ad break. - # @!attribute [rw] slate - # @return [::Google::Cloud::Video::LiveStream::V1::Event::SlateTask] - # Inserts a slate. - # @!attribute [rw] mute - # @return [::Google::Cloud::Video::LiveStream::V1::Event::MuteTask] - # Mutes the stream. - # @!attribute [rw] unmute - # @return [::Google::Cloud::Video::LiveStream::V1::Event::UnmuteTask] - # Unmutes the stream. - # @!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 it will be looped. 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 will fail if the stream is not - # currently muted. - class UnmuteTask - 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 - - # 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. - # @!attribute [rw] image - # @return [::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset] - # ImageAsset represents an image. - # @!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 - # [VideoAsset.uri] or [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 - # [VideoAsset.uri] or [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 format is JPEG. - # @!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. - # @!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. - # @!attribute [rw] sample_aes - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SampleAesEncryption] - # Configuration for HLS SAMPLE-AES encryption. - # @!attribute [rw] mpeg_cenc - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::MpegCommonEncryption] - # Configuration for MPEG-Dash Common Encryption (MPEG-CENC). - 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] - # Widevine configuration. - # @!attribute [rw] fairplay - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Fairplay] - # Fairplay configuration. - # @!attribute [rw] playready - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Playready] - # Playready configuration. - # @!attribute [rw] clearkey - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Clearkey] - # 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 - - # 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 59ba6416f4b2..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb +++ /dev/null @@ -1,684 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module 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-z0-9]`, - # could contain dashes (-) in between. - # @!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-z0-9]`, - # could contain dashes (-) in between. - # @!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.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-z0-9]`, - # could contain dashes (-) in between. - # @!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: - # - # * [`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-z0-9]`, - # could contain dashes (-) in between. - # @!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 - - # 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 [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 - 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 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-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 a93d05e10a56..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # 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 b5731a824060..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8c6b19d52e3d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 8e7abcf8f052..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 4ac9c4801a3f..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 09acc69b6125..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 7be9d37b7d84..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents 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 }. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone. - 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 3d6fc9fa3564..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-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 b1a4edab860b..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5c71dee02fcf..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb deleted file mode 100644 index 2f6fd0ca85e6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5179796af42d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a25ca81afc9c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 b0d7ec0fcef4..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb deleted file mode 100644 index 6ef121907782..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 9438d3865ffe..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 a8581a2c1c9d..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 d5a90d6f1ad6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb deleted file mode 100644 index a859a16415b2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 1bcfddcf4c4c..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 cc3e68e14a9a..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5ce9ab53ee26..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 be61d42bd8cf..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_events.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb deleted file mode 100644 index 6b3f73f1b4b3..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 040965f21c67..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/start_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb deleted file mode 100644 index f8ed7573d436..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/stop_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb deleted file mode 100644 index 767f7c0b7e69..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/update_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb deleted file mode 100644 index 7a5b54ae1ce2..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb deleted file mode 100644 index e61c5a50f7ff..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 5cc3dab663f6..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 4971bc8bb0ca..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json +++ /dev/null @@ -1,895 +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_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_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_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 506bed9f1d65..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,380 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::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 }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::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 - Gapic::ServiceStub.stub :new, nil 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 111ecbec1406..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,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -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 - def test_asset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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_event_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil 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, nil 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, nil 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, nil 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, nil 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, nil 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 b6e801c6cc3a..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,1311 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/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: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - 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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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_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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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:| - assert options.metadata.key? :"x-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 - Gapic::Rest::ClientStub.stub :new, nil 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 bf3c8c239da2..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,1513 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/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::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - 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_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_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_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 - Gapic::ServiceStub.stub :new, nil 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_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - Gapic::ServiceStub.stub :new, nil 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 733ebfbb09ac..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 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" diff --git a/owl-bot-staging/google-cloud-video-live_stream/.gitignore b/owl-bot-staging/google-cloud-video-live_stream/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/.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/.repo-metadata.json b/owl-bot-staging/google-cloud-video-live_stream/.repo-metadata.json deleted file mode 100644 index 477c8211cefe..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/.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/latest", - "distribution_name": "google-cloud-video-live_stream", - "is_cloud": true, - "language": "ruby", - "name": "livestream", - "name_pretty": "Live Stream 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.", - "ruby-cloud-product-url": "https://cloud.google.com/livestream/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml b/owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml deleted file mode 100644 index 0b685af2be48..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-video-live_stream.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-video-live_stream.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-video-live_stream/.toys.rb b/owl-bot-staging/google-cloud-video-live_stream/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-video-live_stream/.yardopts b/owl-bot-staging/google-cloud-video-live_stream/.yardopts deleted file mode 100644 index be95511d9eae..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Live Stream 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-video-live_stream/AUTHENTICATION.md b/owl-bot-staging/google-cloud-video-live_stream/AUTHENTICATION.md deleted file mode 100644 index 9d50f4481173..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-video-live_stream 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 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" - -client = Google::Cloud::Video::LiveStream.livestream_service 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" - -Google::Cloud::Video::LiveStream.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Video::LiveStream.livestream_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-video-live_stream -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" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Video::LiveStream.livestream_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-video-live_stream/CHANGELOG.md b/owl-bot-staging/google-cloud-video-live_stream/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-video-live_stream/Gemfile b/owl-bot-staging/google-cloud-video-live_stream/Gemfile deleted file mode 100644 index a7f25bb01d1d..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-cloud-video-live_stream-v1", path: "../google-cloud-video-live_stream-v1" diff --git a/owl-bot-staging/google-cloud-video-live_stream/LICENSE.md b/owl-bot-staging/google-cloud-video-live_stream/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/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/README.md b/owl-bot-staging/google-cloud-video-live_stream/README.md deleted file mode 100644 index 5628817e02d3..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# Ruby Client for the Live Stream API - -API Client library for the Live Stream 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. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-video-live_stream-v*`. -The gem `google-cloud-video-live_stream` is the main client library that brings the -verisoned 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-video-live_stream/latest) -for this library, google-cloud-video-live_stream, 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-video-live_stream-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/livestream/) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-video-live_stream -``` - -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. {file:AUTHENTICATION.md Set up authentication.} - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -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/Rakefile b/owl-bot-staging/google-cloud-video-live_stream/Rakefile deleted file mode 100644 index ac1dc7bd53e6..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = true -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-video-live_stream" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -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 - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-video-live_stream" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -end - -# Acceptance tests -desc "Run the google-cloud-video-live_stream 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 gem has no acceptance tests." - end - end - - desc "Run acceptance tests with coverage." - task :coverage do - 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 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 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 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-video-live_stream" - header "google-cloud-video-live_stream rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-video-live_stream yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-video-live_stream 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 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 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/google-cloud-video-live_stream.gemspec b/owl-bot-staging/google-cloud-video-live_stream/google-cloud-video-live_stream.gemspec deleted file mode 100644 index 6d32490e8eb5..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/google-cloud-video-live_stream.gemspec +++ /dev/null @@ -1,36 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/video/live_stream/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-video-live_stream" - gem.version = Google::Cloud::Video::LiveStream::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." - gem.summary = "API Client library for the Live Stream 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 = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-video-live_stream-v1", ">= 0.3", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" -end diff --git a/owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb b/owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb deleted file mode 100644 index 19a71a403c18..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/lib/google-cloud-video-live_stream.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/video/live_stream" unless defined? Google::Cloud::Video::LiveStream::VERSION diff --git a/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb b/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb deleted file mode 100644 index 3121dde4507d..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# Require 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/video/live_stream/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! :video_live_stream do |config| - config.add_field! :endpoint, "livestream.googleapis.com", 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 -end - -module Google - module Cloud - module Video - module LiveStream - ## - # Create a new client object for LivestreamService. - # - # By default, this returns an instance of - # [Google::Cloud::Video::LiveStream::V1::LivestreamService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest/Google-Cloud-Video-LiveStream-V1-LivestreamService-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 LivestreamService 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. - # - # ## About 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). - # - # @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.livestream_service version: :v1, transport: :grpc, &block - require "google/cloud/video/live_stream/#{version.to_s.downcase}" - - package_name = Google::Cloud::Video::LiveStream - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Video::LiveStream.const_get(package_name).const_get(:LivestreamService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Configure the google-cloud-video-live_stream 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.video_live_stream if block_given? - - ::Google::Cloud.configure.video_live_stream - end - end - end - end -end - -helper_path = ::File.join __dir__, "live_stream", "helpers.rb" -require "google/cloud/video/live_stream/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb b/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb deleted file mode 100644 index 190207801664..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/lib/google/cloud/video/live_stream/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Video - module LiveStream - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb b/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb deleted file mode 100644 index f9018b1f8829..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/client_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/video/live_stream" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Video::LiveStream::ClientConstructionMinitest < Minitest::Test - def test_livestream_service_grpc - Gapic::ServiceStub.stub :new, :stub do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Video::LiveStream.livestream_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client, client - end - end - - def test_livestream_service_rest - Gapic::Rest::ClientStub.stub :new, :stub do - client = Google::Cloud::Video::LiveStream.livestream_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb b/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb deleted file mode 100644 index f3e3a42b9abb..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/test/google/cloud/video/live_stream/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "google/cloud/video/live_stream/version" - -class Google::Cloud::Video::LiveStream::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Video::LiveStream::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream/test/helper.rb b/owl-bot-staging/google-cloud-video-live_stream/test/helper.rb deleted file mode 100644 index 733ebfbb09ac..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc"