From f6b9bff7a18bce8bd1512489f0e9cf19acc4994f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 10 Sep 2024 20:56:45 +0000 Subject: [PATCH 1/2] docs: update documentation for 31 day subscription message retention PiperOrigin-RevId: 673028761 Source-Link: https://github.com/googleapis/googleapis/commit/394f626e83786b5f2230d10a774c8db961b5e6b7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/88f68a7024b00ff7e204919a97b87a3007b1123c Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXB1YnN1Yi12MS8uT3dsQm90LnlhbWwiLCJoIjoiODhmNjhhNzAyNGIwMGZmN2UyMDQ5MTlhOTdiODdhMzAwN2IxMTIzYyJ9 --- .../google-cloud-pubsub-v1/.gitignore | 22 + .../.repo-metadata.json | 20 + .../google-cloud-pubsub-v1/.rubocop.yml | 33 + .../google-cloud-pubsub-v1/.toys.rb | 28 + .../google-cloud-pubsub-v1/.yardopts | 12 + .../google-cloud-pubsub-v1/AUTHENTICATION.md | 122 + .../google-cloud-pubsub-v1/CHANGELOG.md | 2 + .../google-cloud-pubsub-v1/Gemfile | 11 + .../google-cloud-pubsub-v1/LICENSE.md | 201 ++ .../google-cloud-pubsub-v1/README.md | 144 ++ .../google-cloud-pubsub-v1/Rakefile | 169 ++ .../gapic_metadata.json | 211 ++ .../google-cloud-pubsub-v1.gemspec | 29 + .../lib/google-cloud-pubsub-v1.rb | 21 + .../lib/google/cloud/pubsub/v1.rb | 42 + .../lib/google/cloud/pubsub/v1/publisher.rb | 50 + .../cloud/pubsub/v1/publisher/client.rb | 1316 ++++++++++ .../cloud/pubsub/v1/publisher/credentials.rb | 52 + .../google/cloud/pubsub/v1/publisher/paths.rb | 115 + .../google/cloud/pubsub/v1/schema_service.rb | 49 + .../cloud/pubsub/v1/schema_service/client.rb | 1404 +++++++++++ .../pubsub/v1/schema_service/credentials.rb | 52 + .../cloud/pubsub/v1/schema_service/paths.rb | 64 + .../lib/google/cloud/pubsub/v1/subscriber.rb | 51 + .../cloud/pubsub/v1/subscriber/client.rb | 2206 +++++++++++++++++ .../cloud/pubsub/v1/subscriber/credentials.rb | 52 + .../cloud/pubsub/v1/subscriber/paths.rb | 115 + .../lib/google/cloud/pubsub/v1/version.rb | 28 + .../lib/google/pubsub/v1/pubsub_pb.rb | 115 + .../google/pubsub/v1/pubsub_services_pb.rb | 203 ++ .../lib/google/pubsub/v1/schema_pb.rb | 67 + .../google/pubsub/v1/schema_services_pb.rb | 63 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 420 ++++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../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/pubsub/v1/pubsub.rb | 1489 +++++++++++ .../proto_docs/google/pubsub/v1/schema.rb | 303 +++ .../proto_docs/google/type/expr.rb | 75 + .../google-cloud-pubsub-v1/snippets/Gemfile | 32 + .../snippets/publisher/create_topic.rb | 47 + .../snippets/publisher/delete_topic.rb | 47 + .../snippets/publisher/detach_subscription.rb | 47 + .../snippets/publisher/get_topic.rb | 47 + .../publisher/list_topic_snapshots.rb | 47 + .../publisher/list_topic_subscriptions.rb | 47 + .../snippets/publisher/list_topics.rb | 51 + .../snippets/publisher/publish.rb | 47 + .../snippets/publisher/update_topic.rb | 47 + .../snippets/schema_service/commit_schema.rb | 47 + .../snippets/schema_service/create_schema.rb | 47 + .../snippets/schema_service/delete_schema.rb | 47 + .../schema_service/delete_schema_revision.rb | 47 + .../snippets/schema_service/get_schema.rb | 47 + .../schema_service/list_schema_revisions.rb | 51 + .../snippets/schema_service/list_schemas.rb | 51 + .../schema_service/rollback_schema.rb | 47 + .../schema_service/validate_message.rb | 47 + .../schema_service/validate_schema.rb | 47 + .../snippet_metadata_google.pubsub.v1.json | 1415 +++++++++++ .../snippets/subscriber/acknowledge.rb | 47 + .../snippets/subscriber/create_snapshot.rb | 47 + .../subscriber/create_subscription.rb | 47 + .../snippets/subscriber/delete_snapshot.rb | 47 + .../subscriber/delete_subscription.rb | 47 + .../snippets/subscriber/get_snapshot.rb | 47 + .../snippets/subscriber/get_subscription.rb | 47 + .../snippets/subscriber/list_snapshots.rb | 51 + .../snippets/subscriber/list_subscriptions.rb | 51 + .../subscriber/modify_ack_deadline.rb | 47 + .../snippets/subscriber/modify_push_config.rb | 47 + .../snippets/subscriber/pull.rb | 47 + .../snippets/subscriber/seek.rb | 47 + .../snippets/subscriber/streaming_pull.rb | 56 + .../snippets/subscriber/update_snapshot.rb | 47 + .../subscriber/update_subscription.rb | 47 + .../cloud/pubsub/v1/publisher_paths_test.rb | 86 + .../google/cloud/pubsub/v1/publisher_test.rb | 635 +++++ .../pubsub/v1/schema_service_paths_test.rb | 59 + .../cloud/pubsub/v1/schema_service_test.rb | 699 ++++++ .../cloud/pubsub/v1/subscriber_paths_test.rb | 86 + .../google/cloud/pubsub/v1/subscriber_test.rb | 1123 +++++++++ .../google-cloud-pubsub-v1/test/helper.rb | 25 + 88 files changed, 16065 insertions(+) create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/README.md create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-v1.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/credentials.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/credentials.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_revisions.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb create mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-pubsub-v1/.gitignore b/owl-bot-staging/google-cloud-pubsub-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-pubsub-v1/.repo-metadata.json new file mode 100644 index 000000000000..f62e8968e887 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/.repo-metadata.json @@ -0,0 +1,20 @@ +{ + "api_id": "pubsub.googleapis.com", + "api_shortname": "pubsub", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest", + "distribution_name": "google-cloud-pubsub-v1", + "is_cloud": true, + "language": "ruby", + "name": "pubsub", + "name_pretty": "Cloud Pub/Sub V1 API", + "product_documentation": "https://cloud.google.com/pubsub", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. Note that google-cloud-pubsub-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-pubsub instead. See the readme for more details.", + "ruby-cloud-env-prefix": "PUBSUB", + "ruby-cloud-product-url": "https://cloud.google.com/pubsub", + "ruby-cloud-path-override": "pub_sub=pubsub", + "ruby-cloud-namespace-override": "Pubsub=PubSub", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml b/owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml new file mode 100644 index 000000000000..3c1a114c840b --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-pubsub-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-pubsub-v1.rb" diff --git a/owl-bot-staging/google-cloud-pubsub-v1/.toys.rb b/owl-bot-staging/google-cloud-pubsub-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/.yardopts b/owl-bot-staging/google-cloud-pubsub-v1/.yardopts new file mode 100644 index 000000000000..9db0d6df2152 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Pub/Sub 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-pubsub-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-pubsub-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..335305c07699 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-pubsub-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-pubsub-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/pubsub/v1" + +client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/pubsub/v1" + +::Google::Cloud::PubSub::V1::SchemaService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::PubSub::V1::SchemaService::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-pubsub-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/pubsub/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::PubSub::V1::SchemaService::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-pubsub-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-pubsub-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-pubsub-v1/Gemfile b/owl-bot-staging/google-cloud-pubsub-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-pubsub-v1/LICENSE.md b/owl-bot-staging/google-cloud-pubsub-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/README.md b/owl-bot-staging/google-cloud-pubsub-v1/README.md new file mode 100644 index 000000000000..120afb758a06 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Cloud Pub/Sub V1 API + +Provides reliable, many-to-many, asynchronous messaging between applications. + +Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. + +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 Pub/Sub V1 API. Most users should consider using +the main client gem, +[google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-pubsub-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/pubsub.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/pubsub/v1" + +client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new +request = ::Google::Cloud::PubSub::V1::CreateSchemaRequest.new # (request fields as keyword arguments...) +response = client.create_schema request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/pubsub) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-pubsub`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-pubsub-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-pubsub`. +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-pubsub-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-pubsub-v1/Rakefile b/owl-bot-staging/google-cloud-pubsub-v1/Rakefile new file mode 100644 index 000000000000..86a4aeb64aba --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-pubsub-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["PUBSUB_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["PUBSUB_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["PUBSUB_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 PUBSUB_TEST_PROJECT=test123 PUBSUB_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/pubsub/v1/schema_service/credentials" + ::Google::Cloud::PubSub::V1::SchemaService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["PUBSUB_PROJECT"] = project + ENV["PUBSUB_TEST_PROJECT"] = project + ENV["PUBSUB_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-pubsub-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-pubsub-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-pubsub-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-pubsub-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-pubsub-v1" + header "google-cloud-pubsub-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-pubsub-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-pubsub-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-pubsub-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-pubsub-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-pubsub-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-pubsub-v1/gapic_metadata.json new file mode 100644 index 000000000000..c83bd1885f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/gapic_metadata.json @@ -0,0 +1,211 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.pubsub.v1", + "libraryPackage": "::Google::Cloud::PubSub::V1", + "services": { + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::PubSub::V1::SchemaService::Client", + "rpcs": { + "CreateSchema": { + "methods": [ + "create_schema" + ] + }, + "GetSchema": { + "methods": [ + "get_schema" + ] + }, + "ListSchemas": { + "methods": [ + "list_schemas" + ] + }, + "ListSchemaRevisions": { + "methods": [ + "list_schema_revisions" + ] + }, + "CommitSchema": { + "methods": [ + "commit_schema" + ] + }, + "RollbackSchema": { + "methods": [ + "rollback_schema" + ] + }, + "DeleteSchemaRevision": { + "methods": [ + "delete_schema_revision" + ] + }, + "DeleteSchema": { + "methods": [ + "delete_schema" + ] + }, + "ValidateSchema": { + "methods": [ + "validate_schema" + ] + }, + "ValidateMessage": { + "methods": [ + "validate_message" + ] + } + } + } + } + }, + "Publisher": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::PubSub::V1::Publisher::Client", + "rpcs": { + "CreateTopic": { + "methods": [ + "create_topic" + ] + }, + "UpdateTopic": { + "methods": [ + "update_topic" + ] + }, + "Publish": { + "methods": [ + "publish" + ] + }, + "GetTopic": { + "methods": [ + "get_topic" + ] + }, + "ListTopics": { + "methods": [ + "list_topics" + ] + }, + "ListTopicSubscriptions": { + "methods": [ + "list_topic_subscriptions" + ] + }, + "ListTopicSnapshots": { + "methods": [ + "list_topic_snapshots" + ] + }, + "DeleteTopic": { + "methods": [ + "delete_topic" + ] + }, + "DetachSubscription": { + "methods": [ + "detach_subscription" + ] + } + } + } + } + }, + "Subscriber": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::PubSub::V1::Subscriber::Client", + "rpcs": { + "CreateSubscription": { + "methods": [ + "create_subscription" + ] + }, + "GetSubscription": { + "methods": [ + "get_subscription" + ] + }, + "UpdateSubscription": { + "methods": [ + "update_subscription" + ] + }, + "ListSubscriptions": { + "methods": [ + "list_subscriptions" + ] + }, + "DeleteSubscription": { + "methods": [ + "delete_subscription" + ] + }, + "ModifyAckDeadline": { + "methods": [ + "modify_ack_deadline" + ] + }, + "Acknowledge": { + "methods": [ + "acknowledge" + ] + }, + "Pull": { + "methods": [ + "pull" + ] + }, + "StreamingPull": { + "methods": [ + "streaming_pull" + ] + }, + "ModifyPushConfig": { + "methods": [ + "modify_push_config" + ] + }, + "GetSnapshot": { + "methods": [ + "get_snapshot" + ] + }, + "ListSnapshots": { + "methods": [ + "list_snapshots" + ] + }, + "CreateSnapshot": { + "methods": [ + "create_snapshot" + ] + }, + "UpdateSnapshot": { + "methods": [ + "update_snapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "delete_snapshot" + ] + }, + "Seek": { + "methods": [ + "seek" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec b/owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec new file mode 100644 index 000000000000..0ced01f1ba31 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/pubsub/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-pubsub-v1" + gem.version = Google::Cloud::PubSub::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. Note that google-cloud-pubsub-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-pubsub instead. See the readme for more details." + gem.summary = "Provides reliable, many-to-many, asynchronous messaging between applications." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-iam-v1", ">= 0.7", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-v1.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-v1.rb new file mode 100644 index 000000000000..0e85d899ff9d --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-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/pubsub/v1" diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.rb new file mode 100644 index 000000000000..f8c68fb0adc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.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! + +require "google/cloud/pubsub/v1/schema_service" +require "google/cloud/pubsub/v1/publisher" +require "google/cloud/pubsub/v1/subscriber" +require "google/cloud/pubsub/v1/version" + +module Google + module Cloud + module PubSub + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/pubsub/v1" + # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/pubsub/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.rb new file mode 100644 index 000000000000..6ce79c89fcb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.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! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/pubsub/v1/version" + +require "google/cloud/pubsub/v1/publisher/credentials" +require "google/cloud/pubsub/v1/publisher/paths" +require "google/cloud/pubsub/v1/publisher/client" + +module Google + module Cloud + module PubSub + module V1 + ## + # The service that an application uses to manipulate topics, and to send + # messages to a topic. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/pubsub/v1/publisher" + # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new + # + module Publisher + end + end + end + end +end + +helper_path = ::File.join __dir__, "publisher", "helpers.rb" +require "google/cloud/pubsub/v1/publisher/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb new file mode 100644 index 000000000000..1fe189d24472 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb @@ -0,0 +1,1316 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/pubsub/v1/pubsub_pb" +require "google/iam/v1" + +module Google + module Cloud + module PubSub + module V1 + module Publisher + ## + # Client for the Publisher service. + # + # The service that an application uses to manipulate topics, and to send + # messages to a topic. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :publisher_stub + + ## + # Configure the Publisher Client class. + # + # See {::Google::Cloud::PubSub::V1::Publisher::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Publisher clients + # ::Google::Cloud::PubSub::V1::Publisher::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", "PubSub", "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_topic.timeout = 60.0 + default_config.rpcs.create_topic.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_topic.timeout = 60.0 + default_config.rpcs.update_topic.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.publish.timeout = 60.0 + default_config.rpcs.publish.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 4, retry_codes: [10, 1, 13, 8, 2, 14, 4] + } + + default_config.rpcs.get_topic.timeout = 60.0 + default_config.rpcs.get_topic.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.list_topics.timeout = 60.0 + default_config.rpcs.list_topics.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.list_topic_subscriptions.timeout = 60.0 + default_config.rpcs.list_topic_subscriptions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.list_topic_snapshots.timeout = 60.0 + default_config.rpcs.list_topic_snapshots.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.delete_topic.timeout = 60.0 + default_config.rpcs.delete_topic.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.detach_subscription.timeout = 60.0 + default_config.rpcs.detach_subscription.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Publisher 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::PubSub::V1::Publisher::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 + @publisher_stub.universe_domain + end + + ## + # Create a new Publisher client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Publisher 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/pubsub/v1/pubsub_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 + + @publisher_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::PubSub::V1::Publisher::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @publisher_stub.endpoint + config.universe_domain = @publisher_stub.universe_domain + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates the given topic with the given name. See the [resource name rules] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + # + # @overload create_topic(request, options = nil) + # Pass arguments to `create_topic` via a request object, either of type + # {::Google::Cloud::PubSub::V1::Topic} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::Topic, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_topic(name: nil, labels: nil, message_storage_policy: nil, kms_key_name: nil, schema_settings: nil, satisfies_pzs: nil, message_retention_duration: nil, ingestion_data_source_settings: nil) + # Pass arguments to `create_topic` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the topic. It must have the format + # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + # signs (`%`). It must be between 3 and 255 characters in length, and it + # must not start with `"goog"`. + # @param labels [::Hash{::String => ::String}] + # Optional. See [Creating and managing labels] + # (https://cloud.google.com/pubsub/docs/labels). + # @param message_storage_policy [::Google::Cloud::PubSub::V1::MessageStoragePolicy, ::Hash] + # Optional. Policy constraining the set of Google Cloud Platform regions + # where messages published to the topic may be stored. If not present, then + # no constraints are in effect. + # @param kms_key_name [::String] + # Optional. The resource name of the Cloud KMS CryptoKey to be used to + # protect access to messages published on this topic. + # + # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @param schema_settings [::Google::Cloud::PubSub::V1::SchemaSettings, ::Hash] + # Optional. Settings for validating messages published against a schema. + # @param satisfies_pzs [::Boolean] + # Optional. Reserved for future use. This field is set only in responses from + # the server; it is ignored if it is set in any requests. + # @param message_retention_duration [::Google::Protobuf::Duration, ::Hash] + # Optional. Indicates the minimum duration to retain a message after it is + # published to the topic. If this field is set, messages published to the + # topic in the last `message_retention_duration` are always available to + # subscribers. For instance, it allows any attached subscription to [seek to + # a + # timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + # that is up to `message_retention_duration` in the past. If this field is + # not set, message retention is controlled by settings on individual + # subscriptions. Cannot be more than 31 days or less than 10 minutes. + # @param ingestion_data_source_settings [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings, ::Hash] + # Optional. Settings for ingestion from a data source into this topic. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Topic] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Topic] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::Topic.new + # + # # Call the create_topic method. + # result = client.create_topic request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Topic. + # p result + # + def create_topic request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::Topic + + # Converts hash and nil to 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_topic.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_topic.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_topic.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :create_topic, request, options: options 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 an existing topic by updating the fields specified in the update + # mask. Note that certain properties of a topic are not modifiable. + # + # @overload update_topic(request, options = nil) + # Pass arguments to `update_topic` via a request object, either of type + # {::Google::Cloud::PubSub::V1::UpdateTopicRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::UpdateTopicRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_topic(topic: nil, update_mask: nil) + # Pass arguments to `update_topic` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param topic [::Google::Cloud::PubSub::V1::Topic, ::Hash] + # Required. The updated topic object. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Indicates which fields in the provided topic to update. Must be + # specified and non-empty. Note that if `update_mask` contains + # "message_storage_policy" but the `message_storage_policy` is not set in + # the `topic` provided above, then the updated value is determined by the + # policy configured at the project or organization level. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Topic] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Topic] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::UpdateTopicRequest.new + # + # # Call the update_topic method. + # result = client.update_topic request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Topic. + # p result + # + def update_topic request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::UpdateTopicRequest + + # Converts hash and nil to 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_topic.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.topic&.name + header_params["topic.name"] = request.topic.name + end + + request_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_topic.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_topic.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :update_topic, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + # does not exist. + # + # @overload publish(request, options = nil) + # Pass arguments to `publish` via a request object, either of type + # {::Google::Cloud::PubSub::V1::PublishRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::PublishRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload publish(topic: nil, messages: nil) + # Pass arguments to `publish` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param topic [::String] + # Required. The messages in the request will be published on this topic. + # Format is `projects/{project}/topics/{topic}`. + # @param messages [::Array<::Google::Cloud::PubSub::V1::PubsubMessage, ::Hash>] + # Required. The messages to publish. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::PublishResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::PublishResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::PublishRequest.new + # + # # Call the publish method. + # result = client.publish request + # + # # The returned object is of type Google::Cloud::PubSub::V1::PublishResponse. + # p result + # + def publish request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::PublishRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.publish.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.topic + header_params["topic"] = request.topic + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.publish.timeout, + metadata: metadata, + retry_policy: @config.rpcs.publish.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :publish, request, options: options 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 configuration of a topic. + # + # @overload get_topic(request, options = nil) + # Pass arguments to `get_topic` via a request object, either of type + # {::Google::Cloud::PubSub::V1::GetTopicRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::GetTopicRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_topic(topic: nil) + # Pass arguments to `get_topic` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param topic [::String] + # Required. The name of the topic to get. + # Format is `projects/{project}/topics/{topic}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Topic] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Topic] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::GetTopicRequest.new + # + # # Call the get_topic method. + # result = client.get_topic request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Topic. + # p result + # + def get_topic request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetTopicRequest + + # Converts hash and nil to 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_topic.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.topic + header_params["topic"] = request.topic + end + + request_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_topic.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_topic.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :get_topic, request, options: options 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 matching topics. + # + # @overload list_topics(request, options = nil) + # Pass arguments to `list_topics` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListTopicsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListTopicsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_topics(project: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_topics` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The name of the project in which to list topics. + # Format is `projects/{project-id}`. + # @param page_size [::Integer] + # Optional. Maximum number of topics to return. + # @param page_token [::String] + # Optional. The value returned by the last `ListTopicsResponse`; indicates + # that this is a continuation of a prior `ListTopics` call, and that the + # system should return the next page of data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Topic>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Topic>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListTopicsRequest.new + # + # # Call the list_topics method. + # result = client.list_topics request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PubSub::V1::Topic. + # p item + # end + # + def list_topics request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListTopicsRequest + + # Converts hash and nil to 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_topics.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project + header_params["project"] = request.project + end + + request_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_topics.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_topics.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :list_topics, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @publisher_stub, :list_topics, 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 the names of the attached subscriptions on this topic. + # + # @overload list_topic_subscriptions(request, options = nil) + # Pass arguments to `list_topic_subscriptions` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_topic_subscriptions(topic: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_topic_subscriptions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param topic [::String] + # Required. The name of the topic that subscriptions are attached to. + # Format is `projects/{project}/topics/{topic}`. + # @param page_size [::Integer] + # Optional. Maximum number of subscription names to return. + # @param page_token [::String] + # Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + # indicates that this is a continuation of a prior `ListTopicSubscriptions` + # call, and that the system should return the next page of data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new + # + # # Call the list_topic_subscriptions method. + # result = client.list_topic_subscriptions request + # + # # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse. + # p result + # + def list_topic_subscriptions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest + + # Converts hash and nil to 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_topic_subscriptions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.topic + header_params["topic"] = request.topic + end + + request_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_topic_subscriptions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_topic_subscriptions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :list_topic_subscriptions, request, options: options 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 names of the snapshots on this topic. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # + # @overload list_topic_snapshots(request, options = nil) + # Pass arguments to `list_topic_snapshots` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_topic_snapshots(topic: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_topic_snapshots` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param topic [::String] + # Required. The name of the topic that snapshots are attached to. + # Format is `projects/{project}/topics/{topic}`. + # @param page_size [::Integer] + # Optional. Maximum number of snapshot names to return. + # @param page_token [::String] + # Optional. The value returned by the last `ListTopicSnapshotsResponse`; + # indicates that this is a continuation of a prior `ListTopicSnapshots` call, + # and that the system should return the next page of data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new + # + # # Call the list_topic_snapshots method. + # result = client.list_topic_snapshots request + # + # # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse. + # p result + # + def list_topic_snapshots request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest + + # Converts hash and nil to 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_topic_snapshots.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.topic + header_params["topic"] = request.topic + end + + request_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_topic_snapshots.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_topic_snapshots.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :list_topic_snapshots, request, options: options 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 topic with the given name. Returns `NOT_FOUND` if the topic + # does not exist. After a topic is deleted, a new topic may be created with + # the same name; this is an entirely new topic with none of the old + # configuration or subscriptions. Existing subscriptions to this topic are + # not deleted, but their `topic` field is set to `_deleted-topic_`. + # + # @overload delete_topic(request, options = nil) + # Pass arguments to `delete_topic` via a request object, either of type + # {::Google::Cloud::PubSub::V1::DeleteTopicRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::DeleteTopicRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_topic(topic: nil) + # Pass arguments to `delete_topic` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param topic [::String] + # Required. Name of the topic to delete. + # Format is `projects/{project}/topics/{topic}`. + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::DeleteTopicRequest.new + # + # # Call the delete_topic method. + # result = client.delete_topic request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_topic request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteTopicRequest + + # Converts hash and nil to 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_topic.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.topic + header_params["topic"] = request.topic + end + + request_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_topic.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_topic.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :delete_topic, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Detaches a subscription from this topic. All messages retained in the + # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + # will return FAILED_PRECONDITION. If the subscription is a push + # subscription, pushes to the endpoint will stop. + # + # @overload detach_subscription(request, options = nil) + # Pass arguments to `detach_subscription` via a request object, either of type + # {::Google::Cloud::PubSub::V1::DetachSubscriptionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload detach_subscription(subscription: nil) + # Pass arguments to `detach_subscription` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The subscription to detach. + # Format is `projects/{project}/subscriptions/{subscription}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::DetachSubscriptionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::DetachSubscriptionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Publisher::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new + # + # # Call the detach_subscription method. + # result = client.detach_subscription request + # + # # The returned object is of type Google::Cloud::PubSub::V1::DetachSubscriptionResponse. + # p result + # + def detach_subscription request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.detach_subscription.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.detach_subscription.timeout, + metadata: metadata, + retry_policy: @config.rpcs.detach_subscription.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @publisher_stub.call_rpc :detach_subscription, request, options: options 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 Publisher API. + # + # This class represents the configuration for Publisher, + # providing control 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::PubSub::V1::Publisher::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_topic to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PubSub::V1::Publisher::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_topic.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_topic.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials 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 = "pubsub.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 Publisher API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_topic` + # @return [::Gapic::Config::Method] + # + attr_reader :create_topic + ## + # RPC-specific configuration for `update_topic` + # @return [::Gapic::Config::Method] + # + attr_reader :update_topic + ## + # RPC-specific configuration for `publish` + # @return [::Gapic::Config::Method] + # + attr_reader :publish + ## + # RPC-specific configuration for `get_topic` + # @return [::Gapic::Config::Method] + # + attr_reader :get_topic + ## + # RPC-specific configuration for `list_topics` + # @return [::Gapic::Config::Method] + # + attr_reader :list_topics + ## + # RPC-specific configuration for `list_topic_subscriptions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_topic_subscriptions + ## + # RPC-specific configuration for `list_topic_snapshots` + # @return [::Gapic::Config::Method] + # + attr_reader :list_topic_snapshots + ## + # RPC-specific configuration for `delete_topic` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_topic + ## + # RPC-specific configuration for `detach_subscription` + # @return [::Gapic::Config::Method] + # + attr_reader :detach_subscription + + # @private + def initialize parent_rpcs = nil + create_topic_config = parent_rpcs.create_topic if parent_rpcs.respond_to? :create_topic + @create_topic = ::Gapic::Config::Method.new create_topic_config + update_topic_config = parent_rpcs.update_topic if parent_rpcs.respond_to? :update_topic + @update_topic = ::Gapic::Config::Method.new update_topic_config + publish_config = parent_rpcs.publish if parent_rpcs.respond_to? :publish + @publish = ::Gapic::Config::Method.new publish_config + get_topic_config = parent_rpcs.get_topic if parent_rpcs.respond_to? :get_topic + @get_topic = ::Gapic::Config::Method.new get_topic_config + list_topics_config = parent_rpcs.list_topics if parent_rpcs.respond_to? :list_topics + @list_topics = ::Gapic::Config::Method.new list_topics_config + list_topic_subscriptions_config = parent_rpcs.list_topic_subscriptions if parent_rpcs.respond_to? :list_topic_subscriptions + @list_topic_subscriptions = ::Gapic::Config::Method.new list_topic_subscriptions_config + list_topic_snapshots_config = parent_rpcs.list_topic_snapshots if parent_rpcs.respond_to? :list_topic_snapshots + @list_topic_snapshots = ::Gapic::Config::Method.new list_topic_snapshots_config + delete_topic_config = parent_rpcs.delete_topic if parent_rpcs.respond_to? :delete_topic + @delete_topic = ::Gapic::Config::Method.new delete_topic_config + detach_subscription_config = parent_rpcs.detach_subscription if parent_rpcs.respond_to? :detach_subscription + @detach_subscription = ::Gapic::Config::Method.new detach_subscription_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/credentials.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/credentials.rb new file mode 100644 index 000000000000..9eb9768e026e --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/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 PubSub + module V1 + module Publisher + # Credentials for the Publisher API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + self.env_vars = [ + "PUBSUB_CREDENTIALS", + "PUBSUB_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PUBSUB_CREDENTIALS_JSON", + "PUBSUB_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-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb new file mode 100644 index 000000000000..0376911efb4d --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PubSub + module V1 + module Publisher + # Path helper methods for the Publisher 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 Schema resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/schemas/{schema}` + # + # @param project [String] + # @param schema [String] + # + # @return [::String] + def schema_path project:, schema: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/schemas/#{schema}" + end + + ## + # Create a fully-qualified Subscription resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/subscriptions/{subscription}` + # + # @param project [String] + # @param subscription [String] + # + # @return [::String] + def subscription_path project:, subscription: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/subscriptions/#{subscription}" + end + + ## + # Create a fully-qualified Topic resource string. + # + # @overload topic_path(project:, topic:) + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @overload topic_path() + # The resource will be in the following format: + # + # `_deleted-topic_` + # + # @return [::String] + def topic_path **args + resources = { + "project:topic" => (proc do |project:, topic:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end), + "" => (proc do + "_deleted-topic_" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.rb new file mode 100644 index 000000000000..a21c0de3bf59 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.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 "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/pubsub/v1/version" + +require "google/cloud/pubsub/v1/schema_service/credentials" +require "google/cloud/pubsub/v1/schema_service/paths" +require "google/cloud/pubsub/v1/schema_service/client" + +module Google + module Cloud + module PubSub + module V1 + ## + # Service for doing schema-related operations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/pubsub/v1/schema_service" + # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new + # + module SchemaService + end + end + end + end +end + +helper_path = ::File.join __dir__, "schema_service", "helpers.rb" +require "google/cloud/pubsub/v1/schema_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb new file mode 100644 index 000000000000..8fe361fa2917 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb @@ -0,0 +1,1404 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/pubsub/v1/schema_pb" +require "google/iam/v1" + +module Google + module Cloud + module PubSub + module V1 + module SchemaService + ## + # Client for the SchemaService service. + # + # Service for doing schema-related operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :schema_service_stub + + ## + # Configure the SchemaService Client class. + # + # See {::Google::Cloud::PubSub::V1::SchemaService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SchemaService clients + # ::Google::Cloud::PubSub::V1::SchemaService::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", "PubSub", "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_schema.timeout = 60.0 + default_config.rpcs.create_schema.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_schema.timeout = 60.0 + default_config.rpcs.get_schema.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_schemas.timeout = 60.0 + default_config.rpcs.list_schemas.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_schema_revisions.timeout = 60.0 + default_config.rpcs.list_schema_revisions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.commit_schema.timeout = 60.0 + default_config.rpcs.commit_schema.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.rollback_schema.timeout = 60.0 + default_config.rpcs.rollback_schema.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_schema_revision.timeout = 60.0 + default_config.rpcs.delete_schema_revision.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_schema.timeout = 60.0 + default_config.rpcs.delete_schema.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.validate_schema.timeout = 60.0 + default_config.rpcs.validate_schema.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.validate_message.timeout = 60.0 + default_config.rpcs.validate_message.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SchemaService 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::PubSub::V1::SchemaService::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 + @schema_service_stub.universe_domain + end + + ## + # Create a new SchemaService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SchemaService 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/pubsub/v1/schema_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 + + @schema_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::PubSub::V1::SchemaService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a schema. + # + # @overload create_schema(request, options = nil) + # Pass arguments to `create_schema` via a request object, either of type + # {::Google::Cloud::PubSub::V1::CreateSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::CreateSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_schema(parent: nil, schema: nil, schema_id: nil) + # Pass arguments to `create_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 in which to create the schema. + # Format is `projects/{project-id}`. + # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] + # Required. The schema object to create. + # + # This schema's `name` parameter is ignored. The schema object returned + # by CreateSchema will have a `name` made using the given `parent` and + # `schema_id`. + # @param schema_id [::String] + # The ID to use for the schema, which will become the final component of + # the schema's resource name. + # + # See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + # resource name constraints. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::CreateSchemaRequest.new + # + # # Call the create_schema method. + # result = client.create_schema request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Schema. + # p result + # + def create_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::CreateSchemaRequest + + # Converts hash and nil to 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_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :create_schema, request, options: options 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 a schema. + # + # @overload get_schema(request, options = nil) + # Pass arguments to `get_schema` via a request object, either of type + # {::Google::Cloud::PubSub::V1::GetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::GetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_schema(name: nil, view: nil) + # Pass arguments to `get_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the schema to get. + # Format is `projects/{project}/schemas/{schema}`. + # @param view [::Google::Cloud::PubSub::V1::SchemaView] + # The set of fields to return in the response. If not set, returns a Schema + # with all fields filled out. Set to `BASIC` to omit the `definition`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::GetSchemaRequest.new + # + # # Call the get_schema method. + # result = client.get_schema request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Schema. + # p result + # + def get_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetSchemaRequest + + # Converts hash and nil to 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_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :get_schema, request, options: options 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 schemas in a project. + # + # @overload list_schemas(request, options = nil) + # Pass arguments to `list_schemas` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListSchemasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_schemas(parent: nil, view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_schemas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 in which to list schemas. + # Format is `projects/{project-id}`. + # @param view [::Google::Cloud::PubSub::V1::SchemaView] + # The set of Schema fields to return in the response. If not set, returns + # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + # retrieve all fields. + # @param page_size [::Integer] + # Maximum number of schemas to return. + # @param page_token [::String] + # The value returned by the last `ListSchemasResponse`; indicates that + # this is a continuation of a prior `ListSchemas` call, and that the + # system should return the next page of data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Schema>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Schema>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListSchemasRequest.new + # + # # Call the list_schemas method. + # result = client.list_schemas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PubSub::V1::Schema. + # p item + # end + # + def list_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSchemasRequest + + # Converts hash and nil to 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_schemas.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_schemas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :list_schemas, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schemas, 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 schema revisions for the named schema. + # + # @overload list_schema_revisions(request, options = nil) + # Pass arguments to `list_schema_revisions` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_schema_revisions(name: nil, view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_schema_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 schema to list revisions for. + # @param view [::Google::Cloud::PubSub::V1::SchemaView] + # The set of Schema fields to return in the response. If not set, returns + # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + # retrieve all fields. + # @param page_size [::Integer] + # The maximum number of revisions to return per page. + # @param page_token [::String] + # The page token, received from a previous ListSchemaRevisions 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::PubSub::V1::Schema>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Schema>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new + # + # # Call the list_schema_revisions method. + # result = client.list_schema_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::PubSub::V1::Schema. + # p item + # end + # + def list_schema_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest + + # Converts hash and nil to 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_schema_revisions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_schema_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_schema_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :list_schema_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schema_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 + + ## + # Commits a new schema revision to an existing schema. + # + # @overload commit_schema(request, options = nil) + # Pass arguments to `commit_schema` via a request object, either of type + # {::Google::Cloud::PubSub::V1::CommitSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::CommitSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload commit_schema(name: nil, schema: nil) + # Pass arguments to `commit_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the schema we are revising. + # Format is `projects/{project}/schemas/{schema}`. + # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] + # Required. The schema revision to commit. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::CommitSchemaRequest.new + # + # # Call the commit_schema method. + # result = client.commit_schema request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Schema. + # p result + # + def commit_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::CommitSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.commit_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.commit_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.commit_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :commit_schema, request, options: options 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 schema revision that is a copy of the provided revision_id. + # + # @overload rollback_schema(request, options = nil) + # Pass arguments to `rollback_schema` via a request object, either of type + # {::Google::Cloud::PubSub::V1::RollbackSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::RollbackSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_schema(name: nil, revision_id: nil) + # Pass arguments to `rollback_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The schema being rolled back with revision id. + # @param revision_id [::String] + # Required. The revision ID to roll back to. + # It must be a revision of the same schema. + # + # Example: c7cfa2a8 + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::RollbackSchemaRequest.new + # + # # Call the rollback_schema method. + # result = client.rollback_schema request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Schema. + # p result + # + def rollback_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::RollbackSchemaRequest + + # Converts hash and nil to 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_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rollback_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :rollback_schema, request, options: options 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 specific schema revision. + # + # @overload delete_schema_revision(request, options = nil) + # Pass arguments to `delete_schema_revision` via a request object, either of type + # {::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_schema_revision(name: nil, revision_id: nil) + # Pass arguments to `delete_schema_revision` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the schema revision to be deleted, with a revision ID + # explicitly included. + # + # Example: `projects/123/schemas/my-schema@c7cfa2a8` + # @param revision_id [::String] + # Optional. This field is deprecated and should not be used for specifying + # the revision ID. The revision ID should be specified via the `name` + # parameter. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.new + # + # # Call the delete_schema_revision method. + # result = client.delete_schema_revision request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Schema. + # p result + # + def delete_schema_revision request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest + + # Converts hash and nil to 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_schema_revision.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_schema_revision.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_schema_revision.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :delete_schema_revision, request, options: options 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 schema. + # + # @overload delete_schema(request, options = nil) + # Pass arguments to `delete_schema` via a request object, either of type + # {::Google::Cloud::PubSub::V1::DeleteSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::DeleteSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_schema(name: nil) + # Pass arguments to `delete_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 schema to delete. + # Format is `projects/{project}/schemas/{schema}`. + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::DeleteSchemaRequest.new + # + # # Call the delete_schema method. + # result = client.delete_schema request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSchemaRequest + + # Converts hash and nil to 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_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :delete_schema, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Validates a schema. + # + # @overload validate_schema(request, options = nil) + # Pass arguments to `validate_schema` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ValidateSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ValidateSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload validate_schema(parent: nil, schema: nil) + # Pass arguments to `validate_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 in which to validate schemas. + # Format is `projects/{project-id}`. + # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] + # Required. The schema object to validate. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::ValidateSchemaResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::ValidateSchemaResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ValidateSchemaRequest.new + # + # # Call the validate_schema method. + # result = client.validate_schema request + # + # # The returned object is of type Google::Cloud::PubSub::V1::ValidateSchemaResponse. + # p result + # + def validate_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ValidateSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.validate_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.validate_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.validate_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :validate_schema, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Validates a message against a schema. + # + # @overload validate_message(request, options = nil) + # Pass arguments to `validate_message` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ValidateMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ValidateMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload validate_message(parent: nil, name: nil, schema: nil, message: nil, encoding: nil) + # Pass arguments to `validate_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no 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 in which to validate schemas. + # Format is `projects/{project-id}`. + # @param name [::String] + # Name of the schema against which to validate. + # + # Format is `projects/{project}/schemas/{schema}`. + # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] + # Ad-hoc schema against which to validate + # @param message [::String] + # Message to validate against the provided `schema_spec`. + # @param encoding [::Google::Cloud::PubSub::V1::Encoding] + # The encoding expected for messages + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::ValidateMessageResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::ValidateMessageResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ValidateMessageRequest.new + # + # # Call the validate_message method. + # result = client.validate_message request + # + # # The returned object is of type Google::Cloud::PubSub::V1::ValidateMessageResponse. + # p result + # + def validate_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ValidateMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.validate_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.validate_message.timeout, + metadata: metadata, + retry_policy: @config.rpcs.validate_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :validate_message, request, options: options 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 SchemaService API. + # + # This class represents the configuration for SchemaService, + # providing control 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::PubSub::V1::SchemaService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_schema to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PubSub::V1::SchemaService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_schema.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_schema.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials 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 = "pubsub.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 SchemaService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_schema + ## + # RPC-specific configuration for `get_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_schema + ## + # RPC-specific configuration for `list_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_schemas + ## + # RPC-specific configuration for `list_schema_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_schema_revisions + ## + # RPC-specific configuration for `commit_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :commit_schema + ## + # RPC-specific configuration for `rollback_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback_schema + ## + # RPC-specific configuration for `delete_schema_revision` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_schema_revision + ## + # RPC-specific configuration for `delete_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_schema + ## + # RPC-specific configuration for `validate_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_schema + ## + # RPC-specific configuration for `validate_message` + # @return [::Gapic::Config::Method] + # + attr_reader :validate_message + + # @private + def initialize parent_rpcs = nil + create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema + @create_schema = ::Gapic::Config::Method.new create_schema_config + get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema + @get_schema = ::Gapic::Config::Method.new get_schema_config + list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas + @list_schemas = ::Gapic::Config::Method.new list_schemas_config + list_schema_revisions_config = parent_rpcs.list_schema_revisions if parent_rpcs.respond_to? :list_schema_revisions + @list_schema_revisions = ::Gapic::Config::Method.new list_schema_revisions_config + commit_schema_config = parent_rpcs.commit_schema if parent_rpcs.respond_to? :commit_schema + @commit_schema = ::Gapic::Config::Method.new commit_schema_config + rollback_schema_config = parent_rpcs.rollback_schema if parent_rpcs.respond_to? :rollback_schema + @rollback_schema = ::Gapic::Config::Method.new rollback_schema_config + delete_schema_revision_config = parent_rpcs.delete_schema_revision if parent_rpcs.respond_to? :delete_schema_revision + @delete_schema_revision = ::Gapic::Config::Method.new delete_schema_revision_config + delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema + @delete_schema = ::Gapic::Config::Method.new delete_schema_config + validate_schema_config = parent_rpcs.validate_schema if parent_rpcs.respond_to? :validate_schema + @validate_schema = ::Gapic::Config::Method.new validate_schema_config + validate_message_config = parent_rpcs.validate_message if parent_rpcs.respond_to? :validate_message + @validate_message = ::Gapic::Config::Method.new validate_message_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/credentials.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/credentials.rb new file mode 100644 index 000000000000..6ea00bec95bf --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_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 PubSub + module V1 + module SchemaService + # Credentials for the SchemaService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + self.env_vars = [ + "PUBSUB_CREDENTIALS", + "PUBSUB_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PUBSUB_CREDENTIALS_JSON", + "PUBSUB_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-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/paths.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/paths.rb new file mode 100644 index 000000000000..65108811bbcf --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_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 PubSub + module V1 + module SchemaService + # Path helper methods for the SchemaService 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 Schema resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/schemas/{schema}` + # + # @param project [String] + # @param schema [String] + # + # @return [::String] + def schema_path project:, schema: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/schemas/#{schema}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.rb new file mode 100644 index 000000000000..43d94a42cc70 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.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 "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/pubsub/v1/version" + +require "google/cloud/pubsub/v1/subscriber/credentials" +require "google/cloud/pubsub/v1/subscriber/paths" +require "google/cloud/pubsub/v1/subscriber/client" + +module Google + module Cloud + module PubSub + module V1 + ## + # The service that an application uses to manipulate subscriptions and to + # consume messages from a subscription via the `Pull` method or by + # establishing a bi-directional stream using the `StreamingPull` method. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/pubsub/v1/subscriber" + # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new + # + module Subscriber + end + end + end + end +end + +helper_path = ::File.join __dir__, "subscriber", "helpers.rb" +require "google/cloud/pubsub/v1/subscriber/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb new file mode 100644 index 000000000000..27b6bf1553bb --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb @@ -0,0 +1,2206 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/pubsub/v1/pubsub_pb" +require "google/iam/v1" + +module Google + module Cloud + module PubSub + module V1 + module Subscriber + ## + # Client for the Subscriber service. + # + # The service that an application uses to manipulate subscriptions and to + # consume messages from a subscription via the `Pull` method or by + # establishing a bi-directional stream using the `StreamingPull` method. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :subscriber_stub + + ## + # Configure the Subscriber Client class. + # + # See {::Google::Cloud::PubSub::V1::Subscriber::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Subscriber clients + # ::Google::Cloud::PubSub::V1::Subscriber::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", "PubSub", "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_subscription.timeout = 60.0 + default_config.rpcs.create_subscription.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.get_subscription.timeout = 60.0 + default_config.rpcs.get_subscription.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.update_subscription.timeout = 60.0 + default_config.rpcs.update_subscription.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_subscriptions.timeout = 60.0 + default_config.rpcs.list_subscriptions.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.delete_subscription.timeout = 60.0 + default_config.rpcs.delete_subscription.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.modify_ack_deadline.timeout = 60.0 + default_config.rpcs.modify_ack_deadline.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.acknowledge.timeout = 60.0 + default_config.rpcs.acknowledge.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.pull.timeout = 60.0 + default_config.rpcs.pull.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14, 13] + } + + default_config.rpcs.streaming_pull.timeout = 900.0 + default_config.rpcs.streaming_pull.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 4, retry_codes: [4, 8, 10, 13, 14] + } + + default_config.rpcs.modify_push_config.timeout = 60.0 + default_config.rpcs.modify_push_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_snapshot.timeout = 60.0 + default_config.rpcs.get_snapshot.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.list_snapshots.timeout = 60.0 + default_config.rpcs.list_snapshots.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config.rpcs.create_snapshot.timeout = 60.0 + default_config.rpcs.create_snapshot.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_snapshot.timeout = 60.0 + default_config.rpcs.update_snapshot.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_snapshot.timeout = 60.0 + default_config.rpcs.delete_snapshot.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.seek.timeout = 60.0 + default_config.rpcs.seek.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Subscriber 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::PubSub::V1::Subscriber::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 + @subscriber_stub.universe_domain + end + + ## + # Create a new Subscriber client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Subscriber 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/pubsub/v1/pubsub_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 + + @subscriber_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::PubSub::V1::Subscriber::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @subscriber_stub.endpoint + config.universe_domain = @subscriber_stub.universe_domain + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a subscription to a given topic. See the [resource name rules] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + # If the subscription already exists, returns `ALREADY_EXISTS`. + # If the corresponding topic doesn't exist, returns `NOT_FOUND`. + # + # If the name is not provided in the request, the server will assign a random + # name for this subscription on the same project as the topic, conforming + # to the [resource name format] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + # generated name is populated in the returned Subscription object. Note that + # for REST API requests, you must specify a name in the request. + # + # @overload create_subscription(request, options = nil) + # Pass arguments to `create_subscription` via a request object, either of type + # {::Google::Cloud::PubSub::V1::Subscription} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::Subscription, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subscription(name: nil, topic: nil, push_config: nil, bigquery_config: nil, cloud_storage_config: nil, ack_deadline_seconds: nil, retain_acked_messages: nil, message_retention_duration: nil, labels: nil, enable_message_ordering: nil, expiration_policy: nil, filter: nil, dead_letter_policy: nil, retry_policy: nil, detached: nil, enable_exactly_once_delivery: nil) + # Pass arguments to `create_subscription` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the subscription. It must have the format + # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + # start with a letter, and contain only letters (`[A-Za-z]`), numbers + # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + # in length, and it must not start with `"goog"`. + # @param topic [::String] + # Required. The name of the topic from which this subscription is receiving + # messages. Format is `projects/{project}/topics/{topic}`. The value of this + # field will be `_deleted-topic_` if the topic has been deleted. + # @param push_config [::Google::Cloud::PubSub::V1::PushConfig, ::Hash] + # Optional. If push delivery is used with this subscription, this field is + # used to configure it. + # @param bigquery_config [::Google::Cloud::PubSub::V1::BigQueryConfig, ::Hash] + # Optional. If delivery to BigQuery is used with this subscription, this + # field is used to configure it. + # @param cloud_storage_config [::Google::Cloud::PubSub::V1::CloudStorageConfig, ::Hash] + # Optional. If delivery to Google Cloud Storage is used with this + # subscription, this field is used to configure it. + # @param ack_deadline_seconds [::Integer] + # Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + # waits for the subscriber to acknowledge receipt before resending the + # message. In the interval after the message is delivered and before it is + # acknowledged, it is considered to be _outstanding_. During that time + # period, the message will not be redelivered (on a best-effort basis). + # + # For pull subscriptions, this value is used as the initial value for the ack + # deadline. To override this value for a given message, call + # `ModifyAckDeadline` with the corresponding `ack_id` if using + # non-streaming pull or send the `ack_id` in a + # `StreamingModifyAckDeadlineRequest` if using streaming pull. + # The minimum custom deadline you can specify is 10 seconds. + # The maximum custom deadline you can specify is 600 seconds (10 minutes). + # If this parameter is 0, a default value of 10 seconds is used. + # + # For push delivery, this value is also used to set the request timeout for + # the call to the push endpoint. + # + # If the subscriber never acknowledges the message, the Pub/Sub + # system will eventually redeliver the message. + # @param retain_acked_messages [::Boolean] + # Optional. Indicates whether to retain acknowledged messages. If true, then + # messages are not expunged from the subscription's backlog, even if they are + # acknowledged, until they fall out of the `message_retention_duration` + # window. This must be true if you would like to [`Seek` to a timestamp] + # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + # the past to replay previously-acknowledged messages. + # @param message_retention_duration [::Google::Protobuf::Duration, ::Hash] + # Optional. How long to retain unacknowledged messages in the subscription's + # backlog, from the moment a message is published. If `retain_acked_messages` + # is true, then this also configures the retention of acknowledged messages, + # and thus configures how far back in time a `Seek` can be done. Defaults to + # 7 days. Cannot be more than 31 days or less than 10 minutes. + # @param labels [::Hash{::String => ::String}] + # Optional. See [Creating and managing + # labels](https://cloud.google.com/pubsub/docs/labels). + # @param enable_message_ordering [::Boolean] + # Optional. If true, messages published with the same `ordering_key` in + # `PubsubMessage` will be delivered to the subscribers in the order in which + # they are received by the Pub/Sub system. Otherwise, they may be delivered + # in any order. + # @param expiration_policy [::Google::Cloud::PubSub::V1::ExpirationPolicy, ::Hash] + # Optional. A policy that specifies the conditions for this subscription's + # expiration. A subscription is considered active as long as any connected + # subscriber is successfully consuming messages from the subscription or is + # issuing operations on the subscription. If `expiration_policy` is not set, + # a *default policy* with `ttl` of 31 days will be used. The minimum allowed + # value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + # but `expiration_policy.ttl` is not set, the subscription never expires. + # @param filter [::String] + # Optional. An expression written in the Pub/Sub [filter + # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + # then only `PubsubMessage`s whose `attributes` field matches the filter are + # delivered on this subscription. If empty, then no messages are filtered + # out. + # @param dead_letter_policy [::Google::Cloud::PubSub::V1::DeadLetterPolicy, ::Hash] + # Optional. A policy that specifies the conditions for dead lettering + # messages in this subscription. If dead_letter_policy is not set, dead + # lettering is disabled. + # + # The Pub/Sub service account associated with this subscriptions's + # parent project (i.e., + # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + # permission to Acknowledge() messages on this subscription. + # @param retry_policy [::Google::Cloud::PubSub::V1::RetryPolicy, ::Hash] + # Optional. A policy that specifies how Pub/Sub retries message delivery for + # this subscription. + # + # If not set, the default retry policy is applied. This generally implies + # that messages will be retried as soon as possible for healthy subscribers. + # RetryPolicy will be triggered on NACKs or acknowledgement deadline + # exceeded events for a given message. + # @param detached [::Boolean] + # Optional. Indicates whether the subscription is detached from its topic. + # Detached subscriptions don't receive messages from their topic and don't + # retain any backlog. `Pull` and `StreamingPull` requests will return + # FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + # the endpoint will not be made. + # @param enable_exactly_once_delivery [::Boolean] + # Optional. If true, Pub/Sub provides the following guarantees for the + # delivery of a message with a given value of `message_id` on this + # subscription: + # + # * The message sent to a subscriber is guaranteed not to be resent + # before the message's acknowledgement deadline expires. + # * An acknowledged message will not be resent to a subscriber. + # + # Note that subscribers may still receive multiple copies of a message + # when `enable_exactly_once_delivery` is true if the message was published + # multiple times by a publisher client. These copies are considered distinct + # by Pub/Sub and have distinct `message_id` values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Subscription] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Subscription] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::Subscription.new + # + # # Call the create_subscription method. + # result = client.create_subscription request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + # p result + # + def create_subscription request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::Subscription + + # Converts hash and nil to 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_subscription.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_subscription.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_subscription.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :create_subscription, request, options: options 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 configuration details of a subscription. + # + # @overload get_subscription(request, options = nil) + # Pass arguments to `get_subscription` via a request object, either of type + # {::Google::Cloud::PubSub::V1::GetSubscriptionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::GetSubscriptionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_subscription(subscription: nil) + # Pass arguments to `get_subscription` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The name of the subscription to get. + # Format is `projects/{project}/subscriptions/{sub}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Subscription] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Subscription] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new + # + # # Call the get_subscription method. + # result = client.get_subscription request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + # p result + # + def get_subscription request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetSubscriptionRequest + + # Converts hash and nil to 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_subscription.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_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_subscription.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_subscription.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :get_subscription, request, options: options 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 an existing subscription by updating the fields specified in the + # update mask. Note that certain properties of a subscription, such as its + # topic, are not modifiable. + # + # @overload update_subscription(request, options = nil) + # Pass arguments to `update_subscription` via a request object, either of type + # {::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subscription(subscription: nil, update_mask: nil) + # Pass arguments to `update_subscription` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::Google::Cloud::PubSub::V1::Subscription, ::Hash] + # Required. The updated subscription object. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Indicates which fields in the provided subscription to update. + # Must be specified and non-empty. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Subscription] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Subscription] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new + # + # # Call the update_subscription method. + # result = client.update_subscription request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + # p result + # + def update_subscription request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest + + # Converts hash and nil to 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_subscription.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription&.name + header_params["subscription.name"] = request.subscription.name + end + + request_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_subscription.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_subscription.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :update_subscription, request, options: options 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 matching subscriptions. + # + # @overload list_subscriptions(request, options = nil) + # Pass arguments to `list_subscriptions` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListSubscriptionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_subscriptions(project: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_subscriptions` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The name of the project in which to list subscriptions. + # Format is `projects/{project-id}`. + # @param page_size [::Integer] + # Optional. Maximum number of subscriptions to return. + # @param page_token [::String] + # Optional. The value returned by the last `ListSubscriptionsResponse`; + # indicates that this is a continuation of a prior `ListSubscriptions` call, + # and that the system should return the next page of data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new + # + # # Call the list_subscriptions method. + # result = client.list_subscriptions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PubSub::V1::Subscription. + # p item + # end + # + def list_subscriptions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest + + # Converts hash and nil to 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_subscriptions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project + header_params["project"] = request.project + end + + request_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_subscriptions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_subscriptions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :list_subscriptions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @subscriber_stub, :list_subscriptions, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing subscription. All messages retained in the subscription + # are immediately dropped. Calls to `Pull` after deletion will return + # `NOT_FOUND`. After a subscription is deleted, a new one may be created with + # the same name, but the new one has no association with the old + # subscription or its topic unless the same topic is specified. + # + # @overload delete_subscription(request, options = nil) + # Pass arguments to `delete_subscription` via a request object, either of type + # {::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_subscription(subscription: nil) + # Pass arguments to `delete_subscription` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The subscription to delete. + # Format is `projects/{project}/subscriptions/{sub}`. + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new + # + # # Call the delete_subscription method. + # result = client.delete_subscription request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_subscription request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest + + # Converts hash and nil to 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_subscription.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_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_subscription.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_subscription.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :delete_subscription, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Modifies the ack deadline for a specific message. This method is useful + # to indicate that more time is needed to process a message by the + # subscriber, or to make the message available for redelivery if the + # processing was interrupted. Note that this does not modify the + # subscription-level `ackDeadlineSeconds` used for subsequent messages. + # + # @overload modify_ack_deadline(request, options = nil) + # Pass arguments to `modify_ack_deadline` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload modify_ack_deadline(subscription: nil, ack_ids: nil, ack_deadline_seconds: nil) + # Pass arguments to `modify_ack_deadline` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The name of the subscription. + # Format is `projects/{project}/subscriptions/{sub}`. + # @param ack_ids [::Array<::String>] + # Required. List of acknowledgment IDs. + # @param ack_deadline_seconds [::Integer] + # Required. The new ack deadline with respect to the time this request was + # sent to the Pub/Sub system. For example, if the value is 10, the new ack + # deadline will expire 10 seconds after the `ModifyAckDeadline` call was + # made. Specifying zero might immediately make the message available for + # delivery to another subscriber client. This typically results in an + # increase in the rate of message redeliveries (that is, duplicates). + # The minimum deadline you can specify is 0 seconds. + # The maximum deadline you can specify in a single request is 600 seconds + # (10 minutes). + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new + # + # # Call the modify_ack_deadline method. + # result = client.modify_ack_deadline request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def modify_ack_deadline request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.modify_ack_deadline.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.modify_ack_deadline.timeout, + metadata: metadata, + retry_policy: @config.rpcs.modify_ack_deadline.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :modify_ack_deadline, request, options: options 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 the messages associated with the `ack_ids` in the + # `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + # from the subscription. + # + # Acknowledging a message whose ack deadline has expired may succeed, + # but such a message may be redelivered later. Acknowledging a message more + # than once will not result in an error. + # + # @overload acknowledge(request, options = nil) + # Pass arguments to `acknowledge` via a request object, either of type + # {::Google::Cloud::PubSub::V1::AcknowledgeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::AcknowledgeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(subscription: nil, ack_ids: nil) + # Pass arguments to `acknowledge` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The subscription whose message is being acknowledged. + # Format is `projects/{project}/subscriptions/{sub}`. + # @param ack_ids [::Array<::String>] + # Required. The acknowledgment ID for the messages being acknowledged that + # was returned by the Pub/Sub system in the `Pull` response. Must not be + # empty. + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new + # + # # Call the acknowledge method. + # result = client.acknowledge request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def acknowledge request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::AcknowledgeRequest + + # Converts hash and nil to 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.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_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.timeout, + metadata: metadata, + retry_policy: @config.rpcs.acknowledge.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :acknowledge, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pulls messages from the server. + # + # @overload pull(request, options = nil) + # Pass arguments to `pull` via a request object, either of type + # {::Google::Cloud::PubSub::V1::PullRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::PullRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pull(subscription: nil, return_immediately: nil, max_messages: nil) + # Pass arguments to `pull` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The subscription from which messages should be pulled. + # Format is `projects/{project}/subscriptions/{sub}`. + # @param return_immediately [::Boolean] + # Optional. If this field set to true, the system will respond immediately + # even if it there are no messages available to return in the `Pull` + # response. Otherwise, the system may wait (for a bounded amount of time) + # until at least one message is available, rather than returning no messages. + # Warning: setting this field to `true` is discouraged because it adversely + # impacts the performance of `Pull` operations. We recommend that users do + # not set this field. + # @param max_messages [::Integer] + # Required. The maximum number of messages to return for this request. Must + # be a positive integer. The Pub/Sub system may return fewer than the number + # specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::PullResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::PullResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::PullRequest.new + # + # # Call the pull method. + # result = client.pull request + # + # # The returned object is of type Google::Cloud::PubSub::V1::PullResponse. + # p result + # + def pull request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::PullRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.pull.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.pull.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pull.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :pull, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Establishes a stream with the server, which sends messages down to the + # client. The client streams acknowledgements and ack deadline modifications + # back to the server. The server will close the stream and return the status + # on any error. The server may close the stream with status `UNAVAILABLE` to + # reassign server-side resources, in which case, the client should + # re-establish the stream. Flow control can be achieved by configuring the + # underlying RPC channel. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullRequest, ::Hash>] + # An enumerable of {::Google::Cloud::PubSub::V1::StreamingPullRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_pull method to start streaming. + # output = client.streaming_pull input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::PubSub::V1::StreamingPullRequest.new + # input << Google::Cloud::PubSub::V1::StreamingPullRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::PubSub::V1::StreamingPullResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_pull request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::PubSub::V1::StreamingPullRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_pull.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.streaming_pull.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_pull.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :streaming_pull, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Modifies the `PushConfig` for a specified subscription. + # + # This may be used to change a push subscription to a pull one (signified by + # an empty `PushConfig`) or vice versa, or change the endpoint URL and other + # attributes of a push subscription. Messages will accumulate for delivery + # continuously through the call regardless of changes to the `PushConfig`. + # + # @overload modify_push_config(request, options = nil) + # Pass arguments to `modify_push_config` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ModifyPushConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload modify_push_config(subscription: nil, push_config: nil) + # Pass arguments to `modify_push_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The name of the subscription. + # Format is `projects/{project}/subscriptions/{sub}`. + # @param push_config [::Google::Cloud::PubSub::V1::PushConfig, ::Hash] + # Required. The push configuration for future deliveries. + # + # An empty `pushConfig` indicates that the Pub/Sub system should + # stop pushing messages from the given subscription and allow + # messages to be pulled and acknowledged - effectively pausing + # the subscription if `Pull` or `StreamingPull` is not called. + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new + # + # # Call the modify_push_config method. + # result = client.modify_push_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def modify_push_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.modify_push_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.modify_push_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.modify_push_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :modify_push_config, request, options: options 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 configuration details of a snapshot. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # + # @overload get_snapshot(request, options = nil) + # Pass arguments to `get_snapshot` via a request object, either of type + # {::Google::Cloud::PubSub::V1::GetSnapshotRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::GetSnapshotRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_snapshot(snapshot: nil) + # Pass arguments to `get_snapshot` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param snapshot [::String] + # Required. The name of the snapshot to get. + # Format is `projects/{project}/snapshots/{snap}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Snapshot] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Snapshot] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new + # + # # Call the get_snapshot method. + # result = client.get_snapshot request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + # p result + # + def get_snapshot request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetSnapshotRequest + + # Converts hash and nil to 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_snapshot.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.snapshot + header_params["snapshot"] = request.snapshot + end + + request_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_snapshot.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_snapshot.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :get_snapshot, request, options: options 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 existing snapshots. Snapshots are used in [Seek]( + # https://cloud.google.com/pubsub/docs/replay-overview) operations, which + # allow you to manage message acknowledgments in bulk. That is, you can set + # the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # + # @overload list_snapshots(request, options = nil) + # Pass arguments to `list_snapshots` via a request object, either of type + # {::Google::Cloud::PubSub::V1::ListSnapshotsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::ListSnapshotsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_snapshots(project: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_snapshots` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The name of the project in which to list snapshots. + # Format is `projects/{project-id}`. + # @param page_size [::Integer] + # Optional. Maximum number of snapshots to return. + # @param page_token [::String] + # Optional. The value returned by the last `ListSnapshotsResponse`; indicates + # that this is a continuation of a prior `ListSnapshots` call, and that the + # system should return the next page of data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new + # + # # Call the list_snapshots method. + # result = client.list_snapshots request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot. + # p item + # end + # + def list_snapshots request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSnapshotsRequest + + # Converts hash and nil to 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_snapshots.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project + header_params["project"] = request.project + end + + request_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_snapshots.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_snapshots.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :list_snapshots, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @subscriber_stub, :list_snapshots, 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 + + ## + # Creates a snapshot from the requested subscription. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # If the snapshot already exists, returns `ALREADY_EXISTS`. + # If the requested subscription doesn't exist, returns `NOT_FOUND`. + # If the backlog in the subscription is too old -- and the resulting snapshot + # would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + # See also the `Snapshot.expire_time` field. If the name is not provided in + # the request, the server will assign a random + # name for this snapshot on the same project as the subscription, conforming + # to the [resource name format] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + # generated name is populated in the returned Snapshot object. Note that for + # REST API requests, you must specify a name in the request. + # + # @overload create_snapshot(request, options = nil) + # Pass arguments to `create_snapshot` via a request object, either of type + # {::Google::Cloud::PubSub::V1::CreateSnapshotRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::CreateSnapshotRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_snapshot(name: nil, subscription: nil, labels: nil) + # Pass arguments to `create_snapshot` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. User-provided name for this snapshot. If the name is not provided + # in the request, the server will assign a random name for this snapshot on + # the same project as the subscription. Note that for REST API requests, you + # must specify a name. See the [resource name + # rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + # Format is `projects/{project}/snapshots/{snap}`. + # @param subscription [::String] + # Required. The subscription whose backlog the snapshot retains. + # Specifically, the created snapshot is guaranteed to retain: + # (a) The existing backlog on the subscription. More precisely, this is + # defined as the messages in the subscription's backlog that are + # unacknowledged upon the successful completion of the + # `CreateSnapshot` request; as well as: + # (b) Any messages published to the subscription's topic following the + # successful completion of the CreateSnapshot request. + # Format is `projects/{project}/subscriptions/{sub}`. + # @param labels [::Hash{::String => ::String}] + # Optional. See [Creating and managing + # labels](https://cloud.google.com/pubsub/docs/labels). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Snapshot] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Snapshot] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new + # + # # Call the create_snapshot method. + # result = client.create_snapshot request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + # p result + # + def create_snapshot request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::CreateSnapshotRequest + + # Converts hash and nil to 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_snapshot.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_snapshot.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_snapshot.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :create_snapshot, request, options: options 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 an existing snapshot by updating the fields specified in the update + # mask. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # + # @overload update_snapshot(request, options = nil) + # Pass arguments to `update_snapshot` via a request object, either of type + # {::Google::Cloud::PubSub::V1::UpdateSnapshotRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_snapshot(snapshot: nil, update_mask: nil) + # Pass arguments to `update_snapshot` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param snapshot [::Google::Cloud::PubSub::V1::Snapshot, ::Hash] + # Required. The updated snapshot object. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Indicates which fields in the provided snapshot to update. + # Must be specified and non-empty. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::Snapshot] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::Snapshot] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new + # + # # Call the update_snapshot method. + # result = client.update_snapshot request + # + # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + # p result + # + def update_snapshot request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest + + # Converts hash and nil to 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_snapshot.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.snapshot&.name + header_params["snapshot.name"] = request.snapshot.name + end + + request_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_snapshot.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_snapshot.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :update_snapshot, request, options: options 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 an existing snapshot. Snapshots are used in [Seek] + # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + # allow you to manage message acknowledgments in bulk. That is, you can set + # the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # When the snapshot is deleted, all messages retained in the snapshot + # are immediately dropped. After a snapshot is deleted, a new one may be + # created with the same name, but the new one has no association with the old + # snapshot or its subscription, unless the same subscription is specified. + # + # @overload delete_snapshot(request, options = nil) + # Pass arguments to `delete_snapshot` via a request object, either of type + # {::Google::Cloud::PubSub::V1::DeleteSnapshotRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_snapshot(snapshot: nil) + # Pass arguments to `delete_snapshot` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param snapshot [::String] + # Required. The name of the snapshot to delete. + # Format is `projects/{project}/snapshots/{snap}`. + # + # @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/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new + # + # # Call the delete_snapshot method. + # result = client.delete_snapshot request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_snapshot request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest + + # Converts hash and nil to 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_snapshot.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.snapshot + header_params["snapshot"] = request.snapshot + end + + request_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_snapshot.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_snapshot.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :delete_snapshot, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Seeks an existing subscription to a point in time or to a given snapshot, + # whichever is provided in the request. Snapshots are used in [Seek] + # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + # allow you to manage message acknowledgments in bulk. That is, you can set + # the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. Note that both the subscription and the + # snapshot must be on the same topic. + # + # @overload seek(request, options = nil) + # Pass arguments to `seek` via a request object, either of type + # {::Google::Cloud::PubSub::V1::SeekRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::PubSub::V1::SeekRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload seek(subscription: nil, time: nil, snapshot: nil) + # Pass arguments to `seek` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param subscription [::String] + # Required. The subscription to affect. + # @param time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. The time to seek to. + # Messages retained in the subscription that were published before this + # time are marked as acknowledged, and messages retained in the + # subscription that were published after this time are marked as + # unacknowledged. Note that this operation affects only those messages + # retained in the subscription (configured by the combination of + # `message_retention_duration` and `retain_acked_messages`). For example, + # if `time` corresponds to a point before the message retention + # window (or to a point before the system's notion of the subscription + # creation time), only retained messages will be marked as unacknowledged, + # and already-expunged messages will not be restored. + # @param snapshot [::String] + # Optional. The snapshot to seek to. The snapshot's topic must be the same + # as that of the provided subscription. Format is + # `projects/{project}/snapshots/{snap}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::PubSub::V1::SeekResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::PubSub::V1::SeekResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/pubsub/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::PubSub::V1::Subscriber::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::PubSub::V1::SeekRequest.new + # + # # Call the seek method. + # result = client.seek request + # + # # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse. + # p result + # + def seek request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::SeekRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.seek.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::PubSub::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.subscription + header_params["subscription"] = request.subscription + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.seek.timeout, + metadata: metadata, + retry_policy: @config.rpcs.seek.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @subscriber_stub.call_rpc :seek, request, options: options 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 Subscriber API. + # + # This class represents the configuration for Subscriber, + # providing control 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::PubSub::V1::Subscriber::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # 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_subscription to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::PubSub::V1::Subscriber::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_subscription.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_subscription.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials 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 = "pubsub.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 Subscriber API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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_subscription` + # @return [::Gapic::Config::Method] + # + attr_reader :create_subscription + ## + # RPC-specific configuration for `get_subscription` + # @return [::Gapic::Config::Method] + # + attr_reader :get_subscription + ## + # RPC-specific configuration for `update_subscription` + # @return [::Gapic::Config::Method] + # + attr_reader :update_subscription + ## + # RPC-specific configuration for `list_subscriptions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_subscriptions + ## + # RPC-specific configuration for `delete_subscription` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_subscription + ## + # RPC-specific configuration for `modify_ack_deadline` + # @return [::Gapic::Config::Method] + # + attr_reader :modify_ack_deadline + ## + # RPC-specific configuration for `acknowledge` + # @return [::Gapic::Config::Method] + # + attr_reader :acknowledge + ## + # RPC-specific configuration for `pull` + # @return [::Gapic::Config::Method] + # + attr_reader :pull + ## + # RPC-specific configuration for `streaming_pull` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_pull + ## + # RPC-specific configuration for `modify_push_config` + # @return [::Gapic::Config::Method] + # + attr_reader :modify_push_config + ## + # RPC-specific configuration for `get_snapshot` + # @return [::Gapic::Config::Method] + # + attr_reader :get_snapshot + ## + # RPC-specific configuration for `list_snapshots` + # @return [::Gapic::Config::Method] + # + attr_reader :list_snapshots + ## + # RPC-specific configuration for `create_snapshot` + # @return [::Gapic::Config::Method] + # + attr_reader :create_snapshot + ## + # RPC-specific configuration for `update_snapshot` + # @return [::Gapic::Config::Method] + # + attr_reader :update_snapshot + ## + # RPC-specific configuration for `delete_snapshot` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_snapshot + ## + # RPC-specific configuration for `seek` + # @return [::Gapic::Config::Method] + # + attr_reader :seek + + # @private + def initialize parent_rpcs = nil + create_subscription_config = parent_rpcs.create_subscription if parent_rpcs.respond_to? :create_subscription + @create_subscription = ::Gapic::Config::Method.new create_subscription_config + get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription + @get_subscription = ::Gapic::Config::Method.new get_subscription_config + update_subscription_config = parent_rpcs.update_subscription if parent_rpcs.respond_to? :update_subscription + @update_subscription = ::Gapic::Config::Method.new update_subscription_config + list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions + @list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config + delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription + @delete_subscription = ::Gapic::Config::Method.new delete_subscription_config + modify_ack_deadline_config = parent_rpcs.modify_ack_deadline if parent_rpcs.respond_to? :modify_ack_deadline + @modify_ack_deadline = ::Gapic::Config::Method.new modify_ack_deadline_config + acknowledge_config = parent_rpcs.acknowledge if parent_rpcs.respond_to? :acknowledge + @acknowledge = ::Gapic::Config::Method.new acknowledge_config + pull_config = parent_rpcs.pull if parent_rpcs.respond_to? :pull + @pull = ::Gapic::Config::Method.new pull_config + streaming_pull_config = parent_rpcs.streaming_pull if parent_rpcs.respond_to? :streaming_pull + @streaming_pull = ::Gapic::Config::Method.new streaming_pull_config + modify_push_config_config = parent_rpcs.modify_push_config if parent_rpcs.respond_to? :modify_push_config + @modify_push_config = ::Gapic::Config::Method.new modify_push_config_config + get_snapshot_config = parent_rpcs.get_snapshot if parent_rpcs.respond_to? :get_snapshot + @get_snapshot = ::Gapic::Config::Method.new get_snapshot_config + list_snapshots_config = parent_rpcs.list_snapshots if parent_rpcs.respond_to? :list_snapshots + @list_snapshots = ::Gapic::Config::Method.new list_snapshots_config + create_snapshot_config = parent_rpcs.create_snapshot if parent_rpcs.respond_to? :create_snapshot + @create_snapshot = ::Gapic::Config::Method.new create_snapshot_config + update_snapshot_config = parent_rpcs.update_snapshot if parent_rpcs.respond_to? :update_snapshot + @update_snapshot = ::Gapic::Config::Method.new update_snapshot_config + delete_snapshot_config = parent_rpcs.delete_snapshot if parent_rpcs.respond_to? :delete_snapshot + @delete_snapshot = ::Gapic::Config::Method.new delete_snapshot_config + seek_config = parent_rpcs.seek if parent_rpcs.respond_to? :seek + @seek = ::Gapic::Config::Method.new seek_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/credentials.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/credentials.rb new file mode 100644 index 000000000000..2243e2dc1c53 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/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 PubSub + module V1 + module Subscriber + # Credentials for the Subscriber API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + self.env_vars = [ + "PUBSUB_CREDENTIALS", + "PUBSUB_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "PUBSUB_CREDENTIALS_JSON", + "PUBSUB_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-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb new file mode 100644 index 000000000000..34479511576c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PubSub + module V1 + module Subscriber + # Path helper methods for the Subscriber 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 Snapshot resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/snapshots/{snapshot}` + # + # @param project [String] + # @param snapshot [String] + # + # @return [::String] + def snapshot_path project:, snapshot: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/snapshots/#{snapshot}" + end + + ## + # Create a fully-qualified Subscription resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/subscriptions/{subscription}` + # + # @param project [String] + # @param subscription [String] + # + # @return [::String] + def subscription_path project:, subscription: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/subscriptions/#{subscription}" + end + + ## + # Create a fully-qualified Topic resource string. + # + # @overload topic_path(project:, topic:) + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @overload topic_path() + # The resource will be in the following format: + # + # `_deleted-topic_` + # + # @return [::String] + def topic_path **args + resources = { + "project:topic" => (proc do |project:, topic:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end), + "" => (proc do + "_deleted-topic_" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/version.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/version.rb new file mode 100644 index 000000000000..c5bc2736b5e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/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 PubSub + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb new file mode 100644 index 000000000000..d3770e72d070 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/pubsub/v1/pubsub.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/pubsub/v1/schema_pb' + + +descriptor_data = "\n\x1dgoogle/pubsub/v1/pubsub.proto\x12\x10google.pubsub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1dgoogle/pubsub/v1/schema.proto\"a\n\x14MessageStoragePolicy\x12(\n\x1b\x61llowed_persistence_regions\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x65nforce_in_transit\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xb8\x01\n\x0eSchemaSettings\x12\x34\n\x06schema\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12\x31\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32\x1a.google.pubsub.v1.EncodingB\x03\xe0\x41\x01\x12\x1e\n\x11\x66irst_revision_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10last_revision_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xea\x03\n\x1bIngestionDataSourceSettings\x12T\n\x0b\x61ws_kinesis\x18\x01 \x01(\x0b\x32\x38.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesisB\x03\xe0\x41\x01H\x00\x1a\xea\x02\n\nAwsKinesis\x12R\n\x05state\x18\x01 \x01(\x0e\x32>.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.StateB\x03\xe0\x41\x03\x12\x17\n\nstream_arn\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63onsumer_arn\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x61ws_role_arn\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13gcp_service_account\x18\x05 \x01(\tB\x03\xe0\x41\x02\"\x96\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x1d\n\x19KINESIS_PERMISSION_DENIED\x10\x02\x12\x1d\n\x19PUBLISH_PERMISSION_DENIED\x10\x03\x12\x14\n\x10STREAM_NOT_FOUND\x10\x04\x12\x16\n\x12\x43ONSUMER_NOT_FOUND\x10\x05\x42\x08\n\x06source\"\xba\x05\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x06labels\x18\x02 \x03(\x0b\x32#.google.pubsub.v1.Topic.LabelsEntryB\x03\xe0\x41\x01\x12K\n\x16message_storage_policy\x18\x03 \x01(\x0b\x32&.google.pubsub.v1.MessageStoragePolicyB\x03\xe0\x41\x01\x12\x19\n\x0ckms_key_name\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12>\n\x0fschema_settings\x18\x06 \x01(\x0b\x32 .google.pubsub.v1.SchemaSettingsB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x1amessage_retention_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x31\n\x05state\x18\t \x01(\x0e\x32\x1d.google.pubsub.v1.Topic.StateB\x03\xe0\x41\x03\x12Z\n\x1eingestion_data_source_settings\x18\n \x01(\x0b\x32-.google.pubsub.v1.IngestionDataSourceSettingsB\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\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x1c\n\x18INGESTION_RESOURCE_ERROR\x10\x02:T\xea\x41Q\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\x12\x0f_deleted-topic_\"\x80\x02\n\rPubsubMessage\x12\x11\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x01\x12H\n\nattributes\x18\x02 \x03(\x0b\x32/.google.pubsub.v1.PubsubMessage.AttributesEntryB\x03\xe0\x41\x01\x12\x12\n\nmessage_id\x18\x03 \x01(\t\x12\x30\n\x0cpublish_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x0cordering_key\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x0fGetTopicRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\"w\n\x12UpdateTopicRequest\x12+\n\x05topic\x18\x01 \x01(\x0b\x32\x17.google.pubsub.v1.TopicB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"|\n\x0ePublishRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x36\n\x08messages\x18\x02 \x03(\x0b\x32\x1f.google.pubsub.v1.PubsubMessageB\x03\xe0\x41\x02\"+\n\x0fPublishResponse\x12\x18\n\x0bmessage_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\"\x8a\x01\n\x11ListTopicsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\x12ListTopicsResponse\x12,\n\x06topics\x18\x01 \x03(\x0b\x32\x17.google.pubsub.v1.TopicB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x84\x01\n\x1dListTopicSubscriptionsRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x1eListTopicSubscriptionsResponse\x12\x41\n\rsubscriptions\x18\x01 \x03(\tB*\xe0\x41\x01\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x80\x01\n\x19ListTopicSnapshotsRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\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\"R\n\x1aListTopicSnapshotsResponse\x12\x16\n\tsnapshots\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"H\n\x12\x44\x65leteTopicRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\"]\n\x19\x44\x65tachSubscriptionRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\"\x1c\n\x1a\x44\x65tachSubscriptionResponse\"\xef\x08\n\x0cSubscription\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x32\n\x05topic\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x36\n\x0bpush_config\x18\x04 \x01(\x0b\x32\x1c.google.pubsub.v1.PushConfigB\x03\xe0\x41\x01\x12>\n\x0f\x62igquery_config\x18\x12 \x01(\x0b\x32 .google.pubsub.v1.BigQueryConfigB\x03\xe0\x41\x01\x12G\n\x14\x63loud_storage_config\x18\x16 \x01(\x0b\x32$.google.pubsub.v1.CloudStorageConfigB\x03\xe0\x41\x01\x12!\n\x14\x61\x63k_deadline_seconds\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x15retain_acked_messages\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x1amessage_retention_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12?\n\x06labels\x18\t \x03(\x0b\x32*.google.pubsub.v1.Subscription.LabelsEntryB\x03\xe0\x41\x01\x12$\n\x17\x65nable_message_ordering\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x11\x65xpiration_policy\x18\x0b \x01(\x0b\x32\".google.pubsub.v1.ExpirationPolicyB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\x43\n\x12\x64\x65\x61\x64_letter_policy\x18\r \x01(\x0b\x32\".google.pubsub.v1.DeadLetterPolicyB\x03\xe0\x41\x01\x12\x38\n\x0cretry_policy\x18\x0e \x01(\x0b\x32\x1d.google.pubsub.v1.RetryPolicyB\x03\xe0\x41\x01\x12\x15\n\x08\x64\x65tached\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_exactly_once_delivery\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12H\n topic_message_retention_duration\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\x13 \x01(\x0e\x32$.google.pubsub.v1.Subscription.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\">\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x12\n\x0eRESOURCE_ERROR\x10\x02:X\xea\x41U\n\"pubsub.googleapis.com/Subscription\x12/projects/{project}/subscriptions/{subscription}\"\x7f\n\x0bRetryPolicy\x12\x37\n\x0fminimum_backoff\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x0fmaximum_backoff\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"V\n\x10\x44\x65\x61\x64LetterPolicy\x12\x1e\n\x11\x64\x65\x61\x64_letter_topic\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15max_delivery_attempts\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"?\n\x10\x45xpirationPolicy\x12+\n\x03ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\x9a\x04\n\nPushConfig\x12\x1a\n\rpush_endpoint\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\nattributes\x18\x02 \x03(\x0b\x32,.google.pubsub.v1.PushConfig.AttributesEntryB\x03\xe0\x41\x01\x12\x41\n\noidc_token\x18\x03 \x01(\x0b\x32&.google.pubsub.v1.PushConfig.OidcTokenB\x03\xe0\x41\x01H\x00\x12I\n\x0epubsub_wrapper\x18\x04 \x01(\x0b\x32*.google.pubsub.v1.PushConfig.PubsubWrapperB\x03\xe0\x41\x01H\x01\x12\x41\n\nno_wrapper\x18\x05 \x01(\x0b\x32&.google.pubsub.v1.PushConfig.NoWrapperB\x03\xe0\x41\x01H\x01\x1a\x46\n\tOidcToken\x12\"\n\x15service_account_email\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x61udience\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\x0f\n\rPubsubWrapper\x1a(\n\tNoWrapper\x12\x1b\n\x0ewrite_metadata\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x17\n\x15\x61uthentication_methodB\t\n\x07wrapper\"\x8e\x03\n\x0e\x42igQueryConfig\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10use_topic_schema\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1b\n\x0ewrite_metadata\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13\x64rop_unknown_fields\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12:\n\x05state\x18\x05 \x01(\x0e\x32&.google.pubsub.v1.BigQueryConfig.StateB\x03\xe0\x41\x03\x12\x1d\n\x10use_table_schema\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\"\n\x15service_account_email\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x8a\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\r\n\tNOT_FOUND\x10\x03\x12\x13\n\x0fSCHEMA_MISMATCH\x10\x04\x12#\n\x1fIN_TRANSIT_LOCATION_RESTRICTION\x10\x05\"\xe9\x05\n\x12\x43loudStorageConfig\x12\x13\n\x06\x62ucket\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66ilename_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x66ilename_suffix\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x66ilename_datetime_format\x18\n \x01(\tB\x03\xe0\x41\x01\x12K\n\x0btext_config\x18\x04 \x01(\x0b\x32/.google.pubsub.v1.CloudStorageConfig.TextConfigB\x03\xe0\x41\x01H\x00\x12K\n\x0b\x61vro_config\x18\x05 \x01(\x0b\x32/.google.pubsub.v1.CloudStorageConfig.AvroConfigB\x03\xe0\x41\x01H\x00\x12\x34\n\x0cmax_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x16\n\tmax_bytes\x18\x07 \x01(\x03\x42\x03\xe0\x41\x01\x12\x19\n\x0cmax_messages\x18\x08 \x01(\x03\x42\x03\xe0\x41\x01\x12>\n\x05state\x18\t \x01(\x0e\x32*.google.pubsub.v1.CloudStorageConfig.StateB\x03\xe0\x41\x03\x12\"\n\x15service_account_email\x18\x0b \x01(\tB\x03\xe0\x41\x01\x1a\x0c\n\nTextConfig\x1aH\n\nAvroConfig\x12\x1b\n\x0ewrite_metadata\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x10use_topic_schema\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\r\n\tNOT_FOUND\x10\x03\x12#\n\x1fIN_TRANSIT_LOCATION_RESTRICTION\x10\x04\x12\x13\n\x0fSCHEMA_MISMATCH\x10\x05\x42\x0f\n\routput_format\"|\n\x0fReceivedMessage\x12\x13\n\x06\x61\x63k_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x07message\x18\x02 \x01(\x0b\x32\x1f.google.pubsub.v1.PubsubMessageB\x03\xe0\x41\x01\x12\x1d\n\x10\x64\x65livery_attempt\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"Z\n\x16GetSubscriptionRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\"\x8c\x01\n\x19UpdateSubscriptionRequest\x12\x39\n\x0csubscription\x18\x01 \x01(\x0b\x32\x1e.google.pubsub.v1.SubscriptionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x91\x01\n\x18ListSubscriptionsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"u\n\x19ListSubscriptionsResponse\x12:\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x1e.google.pubsub.v1.SubscriptionB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"]\n\x19\x44\x65leteSubscriptionRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\"\x93\x01\n\x17ModifyPushConfigRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x36\n\x0bpush_config\x18\x02 \x01(\x0b\x32\x1c.google.pubsub.v1.PushConfigB\x03\xe0\x41\x02\"\x8d\x01\n\x0bPullRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12!\n\x12return_immediately\x18\x02 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x19\n\x0cmax_messages\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"Q\n\x0cPullResponse\x12\x41\n\x11received_messages\x18\x01 \x03(\x0b\x32!.google.pubsub.v1.ReceivedMessageB\x03\xe0\x41\x01\"\x95\x01\n\x18ModifyAckDeadlineRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x14\n\x07\x61\x63k_ids\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12!\n\x14\x61\x63k_deadline_seconds\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"l\n\x12\x41\x63knowledgeRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x14\n\x07\x61\x63k_ids\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xc7\x02\n\x14StreamingPullRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x14\n\x07\x61\x63k_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12$\n\x17modify_deadline_seconds\x18\x03 \x03(\x05\x42\x03\xe0\x41\x01\x12$\n\x17modify_deadline_ack_ids\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12(\n\x1bstream_ack_deadline_seconds\x18\x05 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\tclient_id\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18max_outstanding_messages\x18\x07 \x01(\x03\x42\x03\xe0\x41\x01\x12\"\n\x15max_outstanding_bytes\x18\x08 \x01(\x03\x42\x03\xe0\x41\x01\"\x9e\x06\n\x15StreamingPullResponse\x12\x41\n\x11received_messages\x18\x01 \x03(\x0b\x32!.google.pubsub.v1.ReceivedMessageB\x03\xe0\x41\x01\x12\x66\n\x18\x61\x63knowledge_confirmation\x18\x05 \x01(\x0b\x32?.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationB\x03\xe0\x41\x01\x12t\n modify_ack_deadline_confirmation\x18\x03 \x01(\x0b\x32\x45.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationB\x03\xe0\x41\x01\x12\x64\n\x17subscription_properties\x18\x04 \x01(\x0b\x32>.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesB\x03\xe0\x41\x01\x1a\x94\x01\n\x17\x41\x63knowledgeConfirmation\x12\x14\n\x07\x61\x63k_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0finvalid_ack_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1e\n\x11unordered_ack_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12%\n\x18temporary_failed_ack_ids\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1az\n\x1dModifyAckDeadlineConfirmation\x12\x14\n\x07\x61\x63k_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0finvalid_ack_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12%\n\x18temporary_failed_ack_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1ak\n\x16SubscriptionProperties\x12*\n\x1d\x65xactly_once_delivery_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12%\n\x18message_ordering_enabled\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x02\n\x15\x43reateSnapshotRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1epubsub.googleapis.com/Snapshot\x12@\n\x0csubscription\x18\x02 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12H\n\x06labels\x18\x03 \x03(\x0b\x32\x33.google.pubsub.v1.CreateSnapshotRequest.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\"\x80\x01\n\x15UpdateSnapshotRequest\x12\x31\n\x08snapshot\x18\x01 \x01(\x0b\x32\x1a.google.pubsub.v1.SnapshotB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xc1\x02\n\x08Snapshot\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\x05topic\x18\x02 \x01(\tB#\xe0\x41\x01\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12;\n\x06labels\x18\x04 \x03(\x0b\x32&.google.pubsub.v1.Snapshot.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:L\xea\x41I\n\x1epubsub.googleapis.com/Snapshot\x12\'projects/{project}/snapshots/{snapshot}\"N\n\x12GetSnapshotRequest\x12\x38\n\x08snapshot\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1epubsub.googleapis.com/Snapshot\"\x8d\x01\n\x14ListSnapshotsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"i\n\x15ListSnapshotsResponse\x12\x32\n\tsnapshots\x18\x01 \x03(\x0b\x32\x1a.google.pubsub.v1.SnapshotB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x15\x44\x65leteSnapshotRequest\x12\x38\n\x08snapshot\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1epubsub.googleapis.com/Snapshot\"\xc6\x01\n\x0bSeekRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12/\n\x04time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12:\n\x08snapshot\x18\x03 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1epubsub.googleapis.com/SnapshotH\x00\x42\x08\n\x06target\"\x0e\n\x0cSeekResponse2\xb8\x0b\n\tPublisher\x12q\n\x0b\x43reateTopic\x12\x17.google.pubsub.v1.Topic\x1a\x17.google.pubsub.v1.Topic\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x1a\x1e/v1/{name=projects/*/topics/*}:\x01*\x12\x91\x01\n\x0bUpdateTopic\x12$.google.pubsub.v1.UpdateTopicRequest\x1a\x17.google.pubsub.v1.Topic\"C\xda\x41\x11topic,update_mask\x82\xd3\xe4\x93\x02)2$/v1/{topic.name=projects/*/topics/*}:\x01*\x12\x93\x01\n\x07Publish\x12 .google.pubsub.v1.PublishRequest\x1a!.google.pubsub.v1.PublishResponse\"C\xda\x41\x0etopic,messages\x82\xd3\xe4\x93\x02,\"\'/v1/{topic=projects/*/topics/*}:publish:\x01*\x12w\n\x08GetTopic\x12!.google.pubsub.v1.GetTopicRequest\x1a\x17.google.pubsub.v1.Topic\"/\xda\x41\x05topic\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{topic=projects/*/topics/*}\x12\x8a\x01\n\nListTopics\x12#.google.pubsub.v1.ListTopicsRequest\x1a$.google.pubsub.v1.ListTopicsResponse\"1\xda\x41\x07project\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{project=projects/*}/topics\x12\xba\x01\n\x16ListTopicSubscriptions\x12/.google.pubsub.v1.ListTopicSubscriptionsRequest\x1a\x30.google.pubsub.v1.ListTopicSubscriptionsResponse\"=\xda\x41\x05topic\x82\xd3\xe4\x93\x02/\x12-/v1/{topic=projects/*/topics/*}/subscriptions\x12\xaa\x01\n\x12ListTopicSnapshots\x12+.google.pubsub.v1.ListTopicSnapshotsRequest\x1a,.google.pubsub.v1.ListTopicSnapshotsResponse\"9\xda\x41\x05topic\x82\xd3\xe4\x93\x02+\x12)/v1/{topic=projects/*/topics/*}/snapshots\x12|\n\x0b\x44\x65leteTopic\x12$.google.pubsub.v1.DeleteTopicRequest\x1a\x16.google.protobuf.Empty\"/\xda\x41\x05topic\x82\xd3\xe4\x93\x02!*\x1f/v1/{topic=projects/*/topics/*}\x12\xad\x01\n\x12\x44\x65tachSubscription\x12+.google.pubsub.v1.DetachSubscriptionRequest\x1a,.google.pubsub.v1.DetachSubscriptionResponse\"<\x82\xd3\xe4\x93\x02\x36\"4/v1/{subscription=projects/*/subscriptions/*}:detach\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub2\xd2\x15\n\nSubscriber\x12\xb4\x01\n\x12\x43reateSubscription\x12\x1e.google.pubsub.v1.Subscription\x1a\x1e.google.pubsub.v1.Subscription\"^\xda\x41+name,topic,push_config,ack_deadline_seconds\x82\xd3\xe4\x93\x02*\x1a%/v1/{name=projects/*/subscriptions/*}:\x01*\x12\xa1\x01\n\x0fGetSubscription\x12(.google.pubsub.v1.GetSubscriptionRequest\x1a\x1e.google.pubsub.v1.Subscription\"D\xda\x41\x0csubscription\x82\xd3\xe4\x93\x02/\x12-/v1/{subscription=projects/*/subscriptions/*}\x12\xbb\x01\n\x12UpdateSubscription\x12+.google.pubsub.v1.UpdateSubscriptionRequest\x1a\x1e.google.pubsub.v1.Subscription\"X\xda\x41\x18subscription,update_mask\x82\xd3\xe4\x93\x02\x37\x32\x32/v1/{subscription.name=projects/*/subscriptions/*}:\x01*\x12\xa6\x01\n\x11ListSubscriptions\x12*.google.pubsub.v1.ListSubscriptionsRequest\x1a+.google.pubsub.v1.ListSubscriptionsResponse\"8\xda\x41\x07project\x82\xd3\xe4\x93\x02(\x12&/v1/{project=projects/*}/subscriptions\x12\x9f\x01\n\x12\x44\x65leteSubscription\x12+.google.pubsub.v1.DeleteSubscriptionRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x0csubscription\x82\xd3\xe4\x93\x02/*-/v1/{subscription=projects/*/subscriptions/*}\x12\xcf\x01\n\x11ModifyAckDeadline\x12*.google.pubsub.v1.ModifyAckDeadlineRequest\x1a\x16.google.protobuf.Empty\"v\xda\x41)subscription,ack_ids,ack_deadline_seconds\x82\xd3\xe4\x93\x02\x44\"?/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline:\x01*\x12\xa8\x01\n\x0b\x41\x63knowledge\x12$.google.pubsub.v1.AcknowledgeRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x14subscription,ack_ids\x82\xd3\xe4\x93\x02>\"9/v1/{subscription=projects/*/subscriptions/*}:acknowledge:\x01*\x12\xd0\x01\n\x04Pull\x12\x1d.google.pubsub.v1.PullRequest\x1a\x1e.google.pubsub.v1.PullResponse\"\x88\x01\xda\x41,subscription,return_immediately,max_messages\xda\x41\x19subscription,max_messages\x82\xd3\xe4\x93\x02\x37\"2/v1/{subscription=projects/*/subscriptions/*}:pull:\x01*\x12\x66\n\rStreamingPull\x12&.google.pubsub.v1.StreamingPullRequest\x1a\'.google.pubsub.v1.StreamingPullResponse\"\x00(\x01\x30\x01\x12\xbb\x01\n\x10ModifyPushConfig\x12).google.pubsub.v1.ModifyPushConfigRequest\x1a\x16.google.protobuf.Empty\"d\xda\x41\x18subscription,push_config\x82\xd3\xe4\x93\x02\x43\">/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig:\x01*\x12\x89\x01\n\x0bGetSnapshot\x12$.google.pubsub.v1.GetSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot\"8\xda\x41\x08snapshot\x82\xd3\xe4\x93\x02\'\x12%/v1/{snapshot=projects/*/snapshots/*}\x12\x96\x01\n\rListSnapshots\x12&.google.pubsub.v1.ListSnapshotsRequest\x1a\'.google.pubsub.v1.ListSnapshotsResponse\"4\xda\x41\x07project\x82\xd3\xe4\x93\x02$\x12\"/v1/{project=projects/*}/snapshots\x12\x97\x01\n\x0e\x43reateSnapshot\x12\'.google.pubsub.v1.CreateSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot\"@\xda\x41\x11name,subscription\x82\xd3\xe4\x93\x02&\x1a!/v1/{name=projects/*/snapshots/*}:\x01*\x12\xa3\x01\n\x0eUpdateSnapshot\x12\'.google.pubsub.v1.UpdateSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot\"L\xda\x41\x14snapshot,update_mask\x82\xd3\xe4\x93\x02/2*/v1/{snapshot.name=projects/*/snapshots/*}:\x01*\x12\x8b\x01\n\x0e\x44\x65leteSnapshot\x12\'.google.pubsub.v1.DeleteSnapshotRequest\x1a\x16.google.protobuf.Empty\"8\xda\x41\x08snapshot\x82\xd3\xe4\x93\x02\'*%/v1/{snapshot=projects/*/snapshots/*}\x12\x84\x01\n\x04Seek\x12\x1d.google.pubsub.v1.SeekRequest\x1a\x1e.google.pubsub.v1.SeekResponse\"=\x82\xd3\xe4\x93\x02\x37\"2/v1/{subscription=projects/*/subscriptions/*}:seek:\x01*\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsubB\xaa\x01\n\x14\x63om.google.pubsub.v1B\x0bPubsubProtoP\x01Z2cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb\xf8\x01\x01\xaa\x02\x16Google.Cloud.PubSub.V1\xca\x02\x16Google\\Cloud\\PubSub\\V1\xea\x02\x19Google::Cloud::PubSub::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.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 PubSub + module V1 + MessageStoragePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.MessageStoragePolicy").msgclass + SchemaSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SchemaSettings").msgclass + IngestionDataSourceSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.IngestionDataSourceSettings").msgclass + IngestionDataSourceSettings::AwsKinesis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis").msgclass + IngestionDataSourceSettings::AwsKinesis::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State").enummodule + Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Topic").msgclass + Topic::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Topic.State").enummodule + PubsubMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PubsubMessage").msgclass + GetTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetTopicRequest").msgclass + UpdateTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateTopicRequest").msgclass + PublishRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PublishRequest").msgclass + PublishResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PublishResponse").msgclass + ListTopicsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicsRequest").msgclass + ListTopicsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicsResponse").msgclass + ListTopicSubscriptionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSubscriptionsRequest").msgclass + ListTopicSubscriptionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSubscriptionsResponse").msgclass + ListTopicSnapshotsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSnapshotsRequest").msgclass + ListTopicSnapshotsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSnapshotsResponse").msgclass + DeleteTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteTopicRequest").msgclass + DetachSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DetachSubscriptionRequest").msgclass + DetachSubscriptionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DetachSubscriptionResponse").msgclass + Subscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Subscription").msgclass + Subscription::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Subscription.State").enummodule + RetryPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.RetryPolicy").msgclass + DeadLetterPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeadLetterPolicy").msgclass + ExpirationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ExpirationPolicy").msgclass + PushConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig").msgclass + PushConfig::OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig.OidcToken").msgclass + PushConfig::PubsubWrapper = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig.PubsubWrapper").msgclass + PushConfig::NoWrapper = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig.NoWrapper").msgclass + BigQueryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.BigQueryConfig").msgclass + BigQueryConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.BigQueryConfig.State").enummodule + CloudStorageConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig").msgclass + CloudStorageConfig::TextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig.TextConfig").msgclass + CloudStorageConfig::AvroConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig.AvroConfig").msgclass + CloudStorageConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig.State").enummodule + ReceivedMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ReceivedMessage").msgclass + GetSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSubscriptionRequest").msgclass + UpdateSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateSubscriptionRequest").msgclass + ListSubscriptionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsRequest").msgclass + ListSubscriptionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsResponse").msgclass + DeleteSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSubscriptionRequest").msgclass + ModifyPushConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ModifyPushConfigRequest").msgclass + PullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PullRequest").msgclass + PullResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PullResponse").msgclass + ModifyAckDeadlineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ModifyAckDeadlineRequest").msgclass + AcknowledgeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.AcknowledgeRequest").msgclass + StreamingPullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullRequest").msgclass + StreamingPullResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse").msgclass + StreamingPullResponse::AcknowledgeConfirmation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation").msgclass + StreamingPullResponse::ModifyAckDeadlineConfirmation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation").msgclass + StreamingPullResponse::SubscriptionProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.SubscriptionProperties").msgclass + CreateSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSnapshotRequest").msgclass + UpdateSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateSnapshotRequest").msgclass + Snapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Snapshot").msgclass + GetSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSnapshotRequest").msgclass + ListSnapshotsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSnapshotsRequest").msgclass + ListSnapshotsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSnapshotsResponse").msgclass + DeleteSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSnapshotRequest").msgclass + SeekRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SeekRequest").msgclass + SeekResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SeekResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb new file mode 100644 index 000000000000..18260902c766 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb @@ -0,0 +1,203 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/pubsub/v1/pubsub.proto for package 'Google.Cloud.PubSub.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/pubsub/v1/pubsub_pb' + +module Google + module Cloud + module PubSub + module V1 + module Publisher + # The service that an application uses to manipulate topics, and to send + # messages to a topic. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.pubsub.v1.Publisher' + + # Creates the given topic with the given name. See the [resource name rules] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + rpc :CreateTopic, ::Google::Cloud::PubSub::V1::Topic, ::Google::Cloud::PubSub::V1::Topic + # Updates an existing topic by updating the fields specified in the update + # mask. Note that certain properties of a topic are not modifiable. + rpc :UpdateTopic, ::Google::Cloud::PubSub::V1::UpdateTopicRequest, ::Google::Cloud::PubSub::V1::Topic + # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic + # does not exist. + rpc :Publish, ::Google::Cloud::PubSub::V1::PublishRequest, ::Google::Cloud::PubSub::V1::PublishResponse + # Gets the configuration of a topic. + rpc :GetTopic, ::Google::Cloud::PubSub::V1::GetTopicRequest, ::Google::Cloud::PubSub::V1::Topic + # Lists matching topics. + rpc :ListTopics, ::Google::Cloud::PubSub::V1::ListTopicsRequest, ::Google::Cloud::PubSub::V1::ListTopicsResponse + # Lists the names of the attached subscriptions on this topic. + rpc :ListTopicSubscriptions, ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse + # Lists the names of the snapshots on this topic. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + rpc :ListTopicSnapshots, ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse + # Deletes the topic with the given name. Returns `NOT_FOUND` if the topic + # does not exist. After a topic is deleted, a new topic may be created with + # the same name; this is an entirely new topic with none of the old + # configuration or subscriptions. Existing subscriptions to this topic are + # not deleted, but their `topic` field is set to `_deleted-topic_`. + rpc :DeleteTopic, ::Google::Cloud::PubSub::V1::DeleteTopicRequest, ::Google::Protobuf::Empty + # Detaches a subscription from this topic. All messages retained in the + # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + # will return FAILED_PRECONDITION. If the subscription is a push + # subscription, pushes to the endpoint will stop. + rpc :DetachSubscription, ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse + end + + Stub = Service.rpc_stub_class + end + module Subscriber + # The service that an application uses to manipulate subscriptions and to + # consume messages from a subscription via the `Pull` method or by + # establishing a bi-directional stream using the `StreamingPull` method. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.pubsub.v1.Subscriber' + + # Creates a subscription to a given topic. See the [resource name rules] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + # If the subscription already exists, returns `ALREADY_EXISTS`. + # If the corresponding topic doesn't exist, returns `NOT_FOUND`. + # + # If the name is not provided in the request, the server will assign a random + # name for this subscription on the same project as the topic, conforming + # to the [resource name format] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + # generated name is populated in the returned Subscription object. Note that + # for REST API requests, you must specify a name in the request. + rpc :CreateSubscription, ::Google::Cloud::PubSub::V1::Subscription, ::Google::Cloud::PubSub::V1::Subscription + # Gets the configuration details of a subscription. + rpc :GetSubscription, ::Google::Cloud::PubSub::V1::GetSubscriptionRequest, ::Google::Cloud::PubSub::V1::Subscription + # Updates an existing subscription by updating the fields specified in the + # update mask. Note that certain properties of a subscription, such as its + # topic, are not modifiable. + rpc :UpdateSubscription, ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, ::Google::Cloud::PubSub::V1::Subscription + # Lists matching subscriptions. + rpc :ListSubscriptions, ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, ::Google::Cloud::PubSub::V1::ListSubscriptionsResponse + # Deletes an existing subscription. All messages retained in the subscription + # are immediately dropped. Calls to `Pull` after deletion will return + # `NOT_FOUND`. After a subscription is deleted, a new one may be created with + # the same name, but the new one has no association with the old + # subscription or its topic unless the same topic is specified. + rpc :DeleteSubscription, ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, ::Google::Protobuf::Empty + # Modifies the ack deadline for a specific message. This method is useful + # to indicate that more time is needed to process a message by the + # subscriber, or to make the message available for redelivery if the + # processing was interrupted. Note that this does not modify the + # subscription-level `ackDeadlineSeconds` used for subsequent messages. + rpc :ModifyAckDeadline, ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, ::Google::Protobuf::Empty + # Acknowledges the messages associated with the `ack_ids` in the + # `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + # from the subscription. + # + # Acknowledging a message whose ack deadline has expired may succeed, + # but such a message may be redelivered later. Acknowledging a message more + # than once will not result in an error. + rpc :Acknowledge, ::Google::Cloud::PubSub::V1::AcknowledgeRequest, ::Google::Protobuf::Empty + # Pulls messages from the server. + rpc :Pull, ::Google::Cloud::PubSub::V1::PullRequest, ::Google::Cloud::PubSub::V1::PullResponse + # Establishes a stream with the server, which sends messages down to the + # client. The client streams acknowledgements and ack deadline modifications + # back to the server. The server will close the stream and return the status + # on any error. The server may close the stream with status `UNAVAILABLE` to + # reassign server-side resources, in which case, the client should + # re-establish the stream. Flow control can be achieved by configuring the + # underlying RPC channel. + rpc :StreamingPull, stream(::Google::Cloud::PubSub::V1::StreamingPullRequest), stream(::Google::Cloud::PubSub::V1::StreamingPullResponse) + # Modifies the `PushConfig` for a specified subscription. + # + # This may be used to change a push subscription to a pull one (signified by + # an empty `PushConfig`) or vice versa, or change the endpoint URL and other + # attributes of a push subscription. Messages will accumulate for delivery + # continuously through the call regardless of changes to the `PushConfig`. + rpc :ModifyPushConfig, ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, ::Google::Protobuf::Empty + # Gets the configuration details of a snapshot. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + rpc :GetSnapshot, ::Google::Cloud::PubSub::V1::GetSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot + # Lists the existing snapshots. Snapshots are used in [Seek]( + # https://cloud.google.com/pubsub/docs/replay-overview) operations, which + # allow you to manage message acknowledgments in bulk. That is, you can set + # the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + rpc :ListSnapshots, ::Google::Cloud::PubSub::V1::ListSnapshotsRequest, ::Google::Cloud::PubSub::V1::ListSnapshotsResponse + # Creates a snapshot from the requested subscription. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # If the snapshot already exists, returns `ALREADY_EXISTS`. + # If the requested subscription doesn't exist, returns `NOT_FOUND`. + # If the backlog in the subscription is too old -- and the resulting snapshot + # would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. + # See also the `Snapshot.expire_time` field. If the name is not provided in + # the request, the server will assign a random + # name for this snapshot on the same project as the subscription, conforming + # to the [resource name format] + # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The + # generated name is populated in the returned Snapshot object. Note that for + # REST API requests, you must specify a name in the request. + rpc :CreateSnapshot, ::Google::Cloud::PubSub::V1::CreateSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot + # Updates an existing snapshot by updating the fields specified in the update + # mask. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, + # which allow you to manage message acknowledgments in bulk. That is, you can + # set the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + rpc :UpdateSnapshot, ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot + # Removes an existing snapshot. Snapshots are used in [Seek] + # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + # allow you to manage message acknowledgments in bulk. That is, you can set + # the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. + # When the snapshot is deleted, all messages retained in the snapshot + # are immediately dropped. After a snapshot is deleted, a new one may be + # created with the same name, but the new one has no association with the old + # snapshot or its subscription, unless the same subscription is specified. + rpc :DeleteSnapshot, ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, ::Google::Protobuf::Empty + # Seeks an existing subscription to a point in time or to a given snapshot, + # whichever is provided in the request. Snapshots are used in [Seek] + # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which + # allow you to manage message acknowledgments in bulk. That is, you can set + # the acknowledgment state of messages in an existing subscription to the + # state captured by a snapshot. Note that both the subscription and the + # snapshot must be on the same topic. + rpc :Seek, ::Google::Cloud::PubSub::V1::SeekRequest, ::Google::Cloud::PubSub::V1::SeekResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb new file mode 100644 index 000000000000..07b3ef8491c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/pubsub/v1/schema.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\x1dgoogle/pubsub/v1/schema.proto\x12\x10google.pubsub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x02\n\x06Schema\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12+\n\x04type\x18\x02 \x01(\x0e\x32\x1d.google.pubsub.v1.Schema.Type\x12\x12\n\ndefinition\x18\x03 \x01(\t\x12\x1b\n\x0brevision_id\x18\x04 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12=\n\x14revision_create_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fPROTOCOL_BUFFER\x10\x01\x12\x08\n\x04\x41VRO\x10\x02:F\xea\x41\x43\n\x1cpubsub.googleapis.com/Schema\x12#projects/{project}/schemas/{schema}\"\x8d\x01\n\x13\x43reateSchemaRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\x12\x1cpubsub.googleapis.com/Schema\x12-\n\x06schema\x18\x02 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaB\x03\xe0\x41\x02\x12\x11\n\tschema_id\x18\x03 \x01(\t\"r\n\x10GetSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12*\n\x04view\x18\x02 \x01(\x0e\x32\x1c.google.pubsub.v1.SchemaView\"\xac\x01\n\x12ListSchemasRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12*\n\x04view\x18\x02 \x01(\x0e\x32\x1c.google.pubsub.v1.SchemaView\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"Y\n\x13ListSchemasResponse\x12)\n\x07schemas\x18\x01 \x03(\x0b\x32\x18.google.pubsub.v1.Schema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa3\x01\n\x1aListSchemaRevisionsRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12*\n\x04view\x18\x02 \x01(\x0e\x32\x1c.google.pubsub.v1.SchemaView\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"a\n\x1bListSchemaRevisionsResponse\x12)\n\x07schemas\x18\x01 \x03(\x0b\x32\x18.google.pubsub.v1.Schema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"x\n\x13\x43ommitSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12-\n\x06schema\x18\x02 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaB\x03\xe0\x41\x02\"e\n\x15RollbackSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12\x18\n\x0brevision_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"m\n\x1b\x44\x65leteSchemaRevisionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12\x1a\n\x0brevision_id\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x01\"I\n\x13\x44\x65leteSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\"\x8b\x01\n\x15ValidateSchemaRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12-\n\x06schema\x18\x02 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaB\x03\xe0\x41\x02\"\x18\n\x16ValidateSchemaResponse\"\x8a\x02\n\x16ValidateMessageRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x31\n\x04name\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cpubsub.googleapis.com/SchemaH\x00\x12*\n\x06schema\x18\x03 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaH\x00\x12\x0f\n\x07message\x18\x04 \x01(\x0c\x12,\n\x08\x65ncoding\x18\x05 \x01(\x0e\x32\x1a.google.pubsub.v1.EncodingB\r\n\x0bschema_spec\"\x19\n\x17ValidateMessageResponse*>\n\nSchemaView\x12\x1b\n\x17SCHEMA_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02*:\n\x08\x45ncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\n\n\x06\x42INARY\x10\x02\x32\x88\r\n\rSchemaService\x12\x9a\x01\n\x0c\x43reateSchema\x12%.google.pubsub.v1.CreateSchemaRequest\x1a\x18.google.pubsub.v1.Schema\"I\xda\x41\x17parent,schema,schema_id\x82\xd3\xe4\x93\x02)\"\x1f/v1/{parent=projects/*}/schemas:\x06schema\x12y\n\tGetSchema\x12\".google.pubsub.v1.GetSchemaRequest\x1a\x18.google.pubsub.v1.Schema\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{name=projects/*/schemas/*}\x12\x8c\x01\n\x0bListSchemas\x12$.google.pubsub.v1.ListSchemasRequest\x1a%.google.pubsub.v1.ListSchemasResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{parent=projects/*}/schemas\x12\xb0\x01\n\x13ListSchemaRevisions\x12,.google.pubsub.v1.ListSchemaRevisionsRequest\x1a-.google.pubsub.v1.ListSchemaRevisionsResponse\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/schemas/*}:listRevisions\x12\x90\x01\n\x0c\x43ommitSchema\x12%.google.pubsub.v1.CommitSchemaRequest\x1a\x18.google.pubsub.v1.Schema\"?\xda\x41\x0bname,schema\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/schemas/*}:commit:\x01*\x12\x9b\x01\n\x0eRollbackSchema\x12\'.google.pubsub.v1.RollbackSchemaRequest\x1a\x18.google.pubsub.v1.Schema\"F\xda\x41\x10name,revision_id\x82\xd3\xe4\x93\x02-\"(/v1/{name=projects/*/schemas/*}:rollback:\x01*\x12\xaa\x01\n\x14\x44\x65leteSchemaRevision\x12-.google.pubsub.v1.DeleteSchemaRevisionRequest\x1a\x18.google.pubsub.v1.Schema\"I\xda\x41\x10name,revision_id\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/schemas/*}:deleteRevision\x12}\n\x0c\x44\x65leteSchema\x12%.google.pubsub.v1.DeleteSchemaRequest\x1a\x16.google.protobuf.Empty\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!*\x1f/v1/{name=projects/*/schemas/*}\x12\xa8\x01\n\x0eValidateSchema\x12\'.google.pubsub.v1.ValidateSchemaRequest\x1a(.google.pubsub.v1.ValidateSchemaResponse\"C\xda\x41\rparent,schema\x82\xd3\xe4\x93\x02-\"(/v1/{parent=projects/*}/schemas:validate:\x01*\x12\xa2\x01\n\x0fValidateMessage\x12(.google.pubsub.v1.ValidateMessageRequest\x1a).google.pubsub.v1.ValidateMessageResponse\":\x82\xd3\xe4\x93\x02\x34\"//v1/{parent=projects/*}/schemas:validateMessage:\x01*\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsubB\xaa\x01\n\x14\x63om.google.pubsub.v1B\x0bSchemaProtoP\x01Z2cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb\xf8\x01\x01\xaa\x02\x16Google.Cloud.PubSub.V1\xca\x02\x16Google\\Cloud\\PubSub\\V1\xea\x02\x19Google::Cloud::PubSub::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module PubSub + module V1 + Schema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Schema").msgclass + Schema::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Schema.Type").enummodule + CreateSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSchemaRequest").msgclass + GetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSchemaRequest").msgclass + ListSchemasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemasRequest").msgclass + ListSchemasResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemasResponse").msgclass + ListSchemaRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemaRevisionsRequest").msgclass + ListSchemaRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemaRevisionsResponse").msgclass + CommitSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CommitSchemaRequest").msgclass + RollbackSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.RollbackSchemaRequest").msgclass + DeleteSchemaRevisionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSchemaRevisionRequest").msgclass + DeleteSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSchemaRequest").msgclass + ValidateSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateSchemaRequest").msgclass + ValidateSchemaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateSchemaResponse").msgclass + ValidateMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateMessageRequest").msgclass + ValidateMessageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateMessageResponse").msgclass + SchemaView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SchemaView").enummodule + Encoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Encoding").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb new file mode 100644 index 000000000000..970d2f67bece --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb @@ -0,0 +1,63 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/pubsub/v1/schema.proto for package 'Google.Cloud.PubSub.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/pubsub/v1/schema_pb' + +module Google + module Cloud + module PubSub + module V1 + module SchemaService + # Service for doing schema-related operations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.pubsub.v1.SchemaService' + + # Creates a schema. + rpc :CreateSchema, ::Google::Cloud::PubSub::V1::CreateSchemaRequest, ::Google::Cloud::PubSub::V1::Schema + # Gets a schema. + rpc :GetSchema, ::Google::Cloud::PubSub::V1::GetSchemaRequest, ::Google::Cloud::PubSub::V1::Schema + # Lists schemas in a project. + rpc :ListSchemas, ::Google::Cloud::PubSub::V1::ListSchemasRequest, ::Google::Cloud::PubSub::V1::ListSchemasResponse + # Lists all schema revisions for the named schema. + rpc :ListSchemaRevisions, ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest, ::Google::Cloud::PubSub::V1::ListSchemaRevisionsResponse + # Commits a new schema revision to an existing schema. + rpc :CommitSchema, ::Google::Cloud::PubSub::V1::CommitSchemaRequest, ::Google::Cloud::PubSub::V1::Schema + # Creates a new schema revision that is a copy of the provided revision_id. + rpc :RollbackSchema, ::Google::Cloud::PubSub::V1::RollbackSchemaRequest, ::Google::Cloud::PubSub::V1::Schema + # Deletes a specific schema revision. + rpc :DeleteSchemaRevision, ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest, ::Google::Cloud::PubSub::V1::Schema + # Deletes a schema. + rpc :DeleteSchema, ::Google::Cloud::PubSub::V1::DeleteSchemaRequest, ::Google::Protobuf::Empty + # Validates a schema. + rpc :ValidateSchema, ::Google::Cloud::PubSub::V1::ValidateSchemaRequest, ::Google::Cloud::PubSub::V1::ValidateSchemaResponse + # Validates a message against a schema. + rpc :ValidateMessage, ::Google::Cloud::PubSub::V1::ValidateMessageRequest, ::Google::Cloud::PubSub::V1::ValidateMessageResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md new file mode 100644 index 000000000000..cd58273f15b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Pub/Sub 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-pubsub-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..2223d8935069 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/client.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..935946d52792 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb new file mode 100644 index 000000000000..4979ccb81b0e --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb @@ -0,0 +1,1489 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PubSub + module V1 + # A policy constraining the storage of messages published to the topic. + # @!attribute [rw] allowed_persistence_regions + # @return [::Array<::String>] + # Optional. A list of IDs of Google Cloud regions where messages that are + # published to the topic may be persisted in storage. Messages published by + # publishers running in non-allowed Google Cloud regions (or running outside + # of Google Cloud altogether) are routed for storage in one of the allowed + # regions. An empty list means that no regions are allowed, and is not a + # valid configuration. + # @!attribute [rw] enforce_in_transit + # @return [::Boolean] + # Optional. If true, `allowed_persistence_regions` is also used to enforce + # in-transit guarantees for messages. That is, Pub/Sub will fail + # Publish operations on this topic and subscribe operations + # on any subscription attached to this topic in any region that is + # not in `allowed_persistence_regions`. + class MessageStoragePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for validating messages published against a schema. + # @!attribute [rw] schema + # @return [::String] + # Required. The name of the schema that messages published should be + # validated against. Format is `projects/{project}/schemas/{schema}`. The + # value of this field will be `_deleted-schema_` if the schema has been + # deleted. + # @!attribute [rw] encoding + # @return [::Google::Cloud::PubSub::V1::Encoding] + # Optional. The encoding of messages validated against `schema`. + # @!attribute [rw] first_revision_id + # @return [::String] + # Optional. The minimum (inclusive) revision allowed for validating messages. + # If empty or not present, allow any revision to be validated against + # last_revision or any revision created before. + # @!attribute [rw] last_revision_id + # @return [::String] + # Optional. The maximum (inclusive) revision allowed for validating messages. + # If empty or not present, allow any revision to be validated against + # first_revision or any revision created after. + class SchemaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for an ingestion data source on a topic. + # @!attribute [rw] aws_kinesis + # @return [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings::AwsKinesis] + # Optional. Amazon Kinesis Data Streams. + class IngestionDataSourceSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Ingestion settings for Amazon Kinesis Data Streams. + # @!attribute [r] state + # @return [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings::AwsKinesis::State] + # Output only. An output-only field that indicates the state of the Kinesis + # ingestion source. + # @!attribute [rw] stream_arn + # @return [::String] + # Required. The Kinesis stream ARN to ingest data from. + # @!attribute [rw] consumer_arn + # @return [::String] + # Required. The Kinesis consumer ARN to used for ingestion in Enhanced + # Fan-Out mode. The consumer must be already created and ready to be used. + # @!attribute [rw] aws_role_arn + # @return [::String] + # Required. AWS role ARN to be used for Federated Identity authentication + # with Kinesis. Check the Pub/Sub docs for how to set up this role and the + # required permissions that need to be attached to it. + # @!attribute [rw] gcp_service_account + # @return [::String] + # Required. The GCP service account to be used for Federated Identity + # authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for + # the provided role). The `aws_role_arn` must be set up with + # `accounts.google.com:sub` equals to this service account number. + class AwsKinesis + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states for ingestion from Amazon Kinesis Data Streams. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # Ingestion is active. + ACTIVE = 1 + + # Permission denied encountered while consuming data from Kinesis. + # This can happen if: + # - The provided `aws_role_arn` does not exist or does not have the + # appropriate permissions attached. + # - The provided `aws_role_arn` is not set up properly for Identity + # Federation using `gcp_service_account`. + # - The Pub/Sub SA is not granted the + # `iam.serviceAccounts.getOpenIdToken` permission on + # `gcp_service_account`. + KINESIS_PERMISSION_DENIED = 2 + + # Permission denied encountered while publishing to the topic. This can + # happen if the Pub/Sub SA has not been granted the [appropriate publish + # permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + PUBLISH_PERMISSION_DENIED = 3 + + # The Kinesis stream does not exist. + STREAM_NOT_FOUND = 4 + + # The Kinesis consumer does not exist. + CONSUMER_NOT_FOUND = 5 + end + end + end + + # A topic resource. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the topic. It must have the format + # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, + # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), + # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent + # signs (`%`). It must be between 3 and 255 characters in length, and it + # must not start with `"goog"`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. See [Creating and managing labels] + # (https://cloud.google.com/pubsub/docs/labels). + # @!attribute [rw] message_storage_policy + # @return [::Google::Cloud::PubSub::V1::MessageStoragePolicy] + # Optional. Policy constraining the set of Google Cloud Platform regions + # where messages published to the topic may be stored. If not present, then + # no constraints are in effect. + # @!attribute [rw] kms_key_name + # @return [::String] + # Optional. The resource name of the Cloud KMS CryptoKey to be used to + # protect access to messages published on this topic. + # + # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + # @!attribute [rw] schema_settings + # @return [::Google::Cloud::PubSub::V1::SchemaSettings] + # Optional. Settings for validating messages published against a schema. + # @!attribute [rw] satisfies_pzs + # @return [::Boolean] + # Optional. Reserved for future use. This field is set only in responses from + # the server; it is ignored if it is set in any requests. + # @!attribute [rw] message_retention_duration + # @return [::Google::Protobuf::Duration] + # Optional. Indicates the minimum duration to retain a message after it is + # published to the topic. If this field is set, messages published to the + # topic in the last `message_retention_duration` are always available to + # subscribers. For instance, it allows any attached subscription to [seek to + # a + # timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) + # that is up to `message_retention_duration` in the past. If this field is + # not set, message retention is controlled by settings on individual + # subscriptions. Cannot be more than 31 days or less than 10 minutes. + # @!attribute [r] state + # @return [::Google::Cloud::PubSub::V1::Topic::State] + # Output only. An output-only field indicating the state of the topic. + # @!attribute [rw] ingestion_data_source_settings + # @return [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings] + # Optional. Settings for ingestion from a data source into this topic. + class Topic + 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 + + # The state of the topic. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # The topic does not have any persistent errors. + ACTIVE = 1 + + # Ingestion from the data source has encountered a permanent error. + # See the more detailed error state in the corresponding ingestion + # source configuration. + INGESTION_RESOURCE_ERROR = 2 + end + end + + # A message that is published by publishers and consumed by subscribers. The + # message must contain either a non-empty data field or at least one attribute. + # Note that client libraries represent this object differently + # depending on the language. See the corresponding [client library + # documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for + # more information. See [quotas and limits] + # (https://cloud.google.com/pubsub/quotas) for more information about message + # limits. + # @!attribute [rw] data + # @return [::String] + # Optional. The message data field. If this field is empty, the message must + # contain at least one attribute. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Attributes for this message. If this field is empty, the message + # must contain non-empty data. This can be used to filter messages on the + # subscription. + # @!attribute [rw] message_id + # @return [::String] + # ID of this message, assigned by the server when the message is published. + # Guaranteed to be unique within the topic. This value may be read by a + # subscriber that receives a `PubsubMessage` via a `Pull` call or a push + # delivery. It must not be populated by the publisher in a `Publish` call. + # @!attribute [rw] publish_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the message was published, populated by the server when + # it receives the `Publish` call. It must not be populated by the + # publisher in a `Publish` call. + # @!attribute [rw] ordering_key + # @return [::String] + # Optional. If non-empty, identifies related messages for which publish order + # should be respected. If a `Subscription` has `enable_message_ordering` set + # to `true`, messages published with the same non-empty `ordering_key` value + # will be delivered to subscribers in the order in which they are received by + # the Pub/Sub system. All `PubsubMessage`s published in a given + # `PublishRequest` must specify the same `ordering_key` value. For more + # information, see [ordering + # messages](https://cloud.google.com/pubsub/docs/ordering). + class PubsubMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for the GetTopic method. + # @!attribute [rw] topic + # @return [::String] + # Required. The name of the topic to get. + # Format is `projects/{project}/topics/{topic}`. + class GetTopicRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the UpdateTopic method. + # @!attribute [rw] topic + # @return [::Google::Cloud::PubSub::V1::Topic] + # Required. The updated topic object. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Indicates which fields in the provided topic to update. Must be + # specified and non-empty. Note that if `update_mask` contains + # "message_storage_policy" but the `message_storage_policy` is not set in + # the `topic` provided above, then the updated value is determined by the + # policy configured at the project or organization level. + class UpdateTopicRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the Publish method. + # @!attribute [rw] topic + # @return [::String] + # Required. The messages in the request will be published on this topic. + # Format is `projects/{project}/topics/{topic}`. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::PubSub::V1::PubsubMessage>] + # Required. The messages to publish. + class PublishRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `Publish` method. + # @!attribute [rw] message_ids + # @return [::Array<::String>] + # Optional. The server-assigned ID of each published message, in the same + # order as the messages in the request. IDs are guaranteed to be unique + # within the topic. + class PublishResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListTopics` method. + # @!attribute [rw] project + # @return [::String] + # Required. The name of the project in which to list topics. + # Format is `projects/{project-id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of topics to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value returned by the last `ListTopicsResponse`; indicates + # that this is a continuation of a prior `ListTopics` call, and that the + # system should return the next page of data. + class ListTopicsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListTopics` method. + # @!attribute [rw] topics + # @return [::Array<::Google::Cloud::PubSub::V1::Topic>] + # Optional. The resulting topics. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. If not empty, indicates that there may be more topics that match + # the request; this value should be passed in a new `ListTopicsRequest`. + class ListTopicsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListTopicSubscriptions` method. + # @!attribute [rw] topic + # @return [::String] + # Required. The name of the topic that subscriptions are attached to. + # Format is `projects/{project}/topics/{topic}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of subscription names to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value returned by the last `ListTopicSubscriptionsResponse`; + # indicates that this is a continuation of a prior `ListTopicSubscriptions` + # call, and that the system should return the next page of data. + class ListTopicSubscriptionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListTopicSubscriptions` method. + # @!attribute [rw] subscriptions + # @return [::Array<::String>] + # Optional. The names of subscriptions attached to the topic specified in the + # request. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. If not empty, indicates that there may be more subscriptions that + # match the request; this value should be passed in a new + # `ListTopicSubscriptionsRequest` to get more subscriptions. + class ListTopicSubscriptionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListTopicSnapshots` method. + # @!attribute [rw] topic + # @return [::String] + # Required. The name of the topic that snapshots are attached to. + # Format is `projects/{project}/topics/{topic}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of snapshot names to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value returned by the last `ListTopicSnapshotsResponse`; + # indicates that this is a continuation of a prior `ListTopicSnapshots` call, + # and that the system should return the next page of data. + class ListTopicSnapshotsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListTopicSnapshots` method. + # @!attribute [rw] snapshots + # @return [::Array<::String>] + # Optional. The names of the snapshots that match the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. If not empty, indicates that there may be more snapshots that + # match the request; this value should be passed in a new + # `ListTopicSnapshotsRequest` to get more snapshots. + class ListTopicSnapshotsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `DeleteTopic` method. + # @!attribute [rw] topic + # @return [::String] + # Required. Name of the topic to delete. + # Format is `projects/{project}/topics/{topic}`. + class DeleteTopicRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the DetachSubscription method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription to detach. + # Format is `projects/{project}/subscriptions/{subscription}`. + class DetachSubscriptionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the DetachSubscription method. + # Reserved for future use. + class DetachSubscriptionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A subscription resource. If none of `push_config`, `bigquery_config`, or + # `cloud_storage_config` is set, then the subscriber will pull and ack messages + # using API methods. At most one of these fields may be set. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the subscription. It must have the format + # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must + # start with a letter, and contain only letters (`[A-Za-z]`), numbers + # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), + # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters + # in length, and it must not start with `"goog"`. + # @!attribute [rw] topic + # @return [::String] + # Required. The name of the topic from which this subscription is receiving + # messages. Format is `projects/{project}/topics/{topic}`. The value of this + # field will be `_deleted-topic_` if the topic has been deleted. + # @!attribute [rw] push_config + # @return [::Google::Cloud::PubSub::V1::PushConfig] + # Optional. If push delivery is used with this subscription, this field is + # used to configure it. + # @!attribute [rw] bigquery_config + # @return [::Google::Cloud::PubSub::V1::BigQueryConfig] + # Optional. If delivery to BigQuery is used with this subscription, this + # field is used to configure it. + # @!attribute [rw] cloud_storage_config + # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig] + # Optional. If delivery to Google Cloud Storage is used with this + # subscription, this field is used to configure it. + # @!attribute [rw] ack_deadline_seconds + # @return [::Integer] + # Optional. The approximate amount of time (on a best-effort basis) Pub/Sub + # waits for the subscriber to acknowledge receipt before resending the + # message. In the interval after the message is delivered and before it is + # acknowledged, it is considered to be _outstanding_. During that time + # period, the message will not be redelivered (on a best-effort basis). + # + # For pull subscriptions, this value is used as the initial value for the ack + # deadline. To override this value for a given message, call + # `ModifyAckDeadline` with the corresponding `ack_id` if using + # non-streaming pull or send the `ack_id` in a + # `StreamingModifyAckDeadlineRequest` if using streaming pull. + # The minimum custom deadline you can specify is 10 seconds. + # The maximum custom deadline you can specify is 600 seconds (10 minutes). + # If this parameter is 0, a default value of 10 seconds is used. + # + # For push delivery, this value is also used to set the request timeout for + # the call to the push endpoint. + # + # If the subscriber never acknowledges the message, the Pub/Sub + # system will eventually redeliver the message. + # @!attribute [rw] retain_acked_messages + # @return [::Boolean] + # Optional. Indicates whether to retain acknowledged messages. If true, then + # messages are not expunged from the subscription's backlog, even if they are + # acknowledged, until they fall out of the `message_retention_duration` + # window. This must be true if you would like to [`Seek` to a timestamp] + # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in + # the past to replay previously-acknowledged messages. + # @!attribute [rw] message_retention_duration + # @return [::Google::Protobuf::Duration] + # Optional. How long to retain unacknowledged messages in the subscription's + # backlog, from the moment a message is published. If `retain_acked_messages` + # is true, then this also configures the retention of acknowledged messages, + # and thus configures how far back in time a `Seek` can be done. Defaults to + # 7 days. Cannot be more than 31 days or less than 10 minutes. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. See [Creating and managing + # labels](https://cloud.google.com/pubsub/docs/labels). + # @!attribute [rw] enable_message_ordering + # @return [::Boolean] + # Optional. If true, messages published with the same `ordering_key` in + # `PubsubMessage` will be delivered to the subscribers in the order in which + # they are received by the Pub/Sub system. Otherwise, they may be delivered + # in any order. + # @!attribute [rw] expiration_policy + # @return [::Google::Cloud::PubSub::V1::ExpirationPolicy] + # Optional. A policy that specifies the conditions for this subscription's + # expiration. A subscription is considered active as long as any connected + # subscriber is successfully consuming messages from the subscription or is + # issuing operations on the subscription. If `expiration_policy` is not set, + # a *default policy* with `ttl` of 31 days will be used. The minimum allowed + # value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, + # but `expiration_policy.ttl` is not set, the subscription never expires. + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression written in the Pub/Sub [filter + # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, + # then only `PubsubMessage`s whose `attributes` field matches the filter are + # delivered on this subscription. If empty, then no messages are filtered + # out. + # @!attribute [rw] dead_letter_policy + # @return [::Google::Cloud::PubSub::V1::DeadLetterPolicy] + # Optional. A policy that specifies the conditions for dead lettering + # messages in this subscription. If dead_letter_policy is not set, dead + # lettering is disabled. + # + # The Pub/Sub service account associated with this subscriptions's + # parent project (i.e., + # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have + # permission to Acknowledge() messages on this subscription. + # @!attribute [rw] retry_policy + # @return [::Google::Cloud::PubSub::V1::RetryPolicy] + # Optional. A policy that specifies how Pub/Sub retries message delivery for + # this subscription. + # + # If not set, the default retry policy is applied. This generally implies + # that messages will be retried as soon as possible for healthy subscribers. + # RetryPolicy will be triggered on NACKs or acknowledgement deadline + # exceeded events for a given message. + # @!attribute [rw] detached + # @return [::Boolean] + # Optional. Indicates whether the subscription is detached from its topic. + # Detached subscriptions don't receive messages from their topic and don't + # retain any backlog. `Pull` and `StreamingPull` requests will return + # FAILED_PRECONDITION. If the subscription is a push subscription, pushes to + # the endpoint will not be made. + # @!attribute [rw] enable_exactly_once_delivery + # @return [::Boolean] + # Optional. If true, Pub/Sub provides the following guarantees for the + # delivery of a message with a given value of `message_id` on this + # subscription: + # + # * The message sent to a subscriber is guaranteed not to be resent + # before the message's acknowledgement deadline expires. + # * An acknowledged message will not be resent to a subscriber. + # + # Note that subscribers may still receive multiple copies of a message + # when `enable_exactly_once_delivery` is true if the message was published + # multiple times by a publisher client. These copies are considered distinct + # by Pub/Sub and have distinct `message_id` values. + # @!attribute [r] topic_message_retention_duration + # @return [::Google::Protobuf::Duration] + # Output only. Indicates the minimum duration for which a message is retained + # after it is published to the subscription's topic. If this field is set, + # messages published to the subscription's topic in the last + # `topic_message_retention_duration` are always available to subscribers. See + # the `message_retention_duration` field in `Topic`. This field is set only + # in responses from the server; it is ignored if it is set in any requests. + # @!attribute [r] state + # @return [::Google::Cloud::PubSub::V1::Subscription::State] + # Output only. An output-only field indicating whether or not the + # subscription can receive messages. + class Subscription + 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 for a subscription. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # The subscription can actively receive messages + ACTIVE = 1 + + # The subscription cannot receive messages because of an error with the + # resource to which it pushes messages. See the more detailed error state + # in the corresponding configuration. + RESOURCE_ERROR = 2 + end + end + + # A policy that specifies how Pub/Sub retries message delivery. + # + # Retry delay will be exponential based on provided minimum and maximum + # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. + # + # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded + # events for a given message. + # + # Retry Policy is implemented on a best effort basis. At times, the delay + # between consecutive deliveries may not match the configuration. That is, + # delay can be more or less than configured backoff. + # @!attribute [rw] minimum_backoff + # @return [::Google::Protobuf::Duration] + # Optional. The minimum delay between consecutive deliveries of a given + # message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. + # @!attribute [rw] maximum_backoff + # @return [::Google::Protobuf::Duration] + # Optional. The maximum delay between consecutive deliveries of a given + # message. Value should be between 0 and 600 seconds. Defaults to 600 + # seconds. + class RetryPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Dead lettering is done on a best effort basis. The same message might be + # dead lettered multiple times. + # + # If validation on any of the fields fails at subscription creation/updation, + # the create/update subscription request will fail. + # @!attribute [rw] dead_letter_topic + # @return [::String] + # Optional. The name of the topic to which dead letter messages should be + # published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub + # service account associated with the enclosing subscription's parent project + # (i.e., service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must + # have permission to Publish() to this topic. + # + # The operation will fail if the topic does not exist. + # Users should ensure that there is a subscription attached to this topic + # since messages published to a topic with no subscriptions are lost. + # @!attribute [rw] max_delivery_attempts + # @return [::Integer] + # Optional. The maximum number of delivery attempts for any message. The + # value must be between 5 and 100. + # + # The number of delivery attempts is defined as 1 + (the sum of number of + # NACKs and number of times the acknowledgement deadline has been exceeded + # for the message). + # + # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that + # client libraries may automatically extend ack_deadlines. + # + # This field will be honored on a best effort basis. + # + # If this parameter is 0, a default value of 5 is used. + class DeadLetterPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A policy that specifies the conditions for resource expiration (i.e., + # automatic resource deletion). + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. Specifies the "time-to-live" duration for an associated resource. + # The resource expires if it is not active for a period of `ttl`. The + # definition of "activity" depends on the type of the associated resource. + # The minimum and maximum allowed values for `ttl` depend on the type of the + # associated resource, as well. If `ttl` is not set, the associated resource + # never expires. + class ExpirationPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a push delivery endpoint. + # @!attribute [rw] push_endpoint + # @return [::String] + # Optional. A URL locating the endpoint to which messages should be pushed. + # For example, a Webhook endpoint might use `https://example.com/push`. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Endpoint configuration attributes that can be used to control + # different aspects of the message delivery. + # + # The only currently supported attribute is `x-goog-version`, which you can + # use to change the format of the pushed message. This attribute + # indicates the version of the data expected by the endpoint. This + # controls the shape of the pushed message (i.e., its fields and metadata). + # + # If not present during the `CreateSubscription` call, it will default to + # the version of the Pub/Sub API used to make such call. If not present in a + # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + # calls will always return a valid version, even if the subscription was + # created without this attribute. + # + # The only supported values for the `x-goog-version` attribute are: + # + # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. + # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. + # + # For example: + # `attributes { "x-goog-version": "v1" }` + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::PubSub::V1::PushConfig::OidcToken] + # Optional. If specified, Pub/Sub will generate and attach an OIDC JWT + # token as an `Authorization` header in the HTTP request for every pushed + # message. + # @!attribute [rw] pubsub_wrapper + # @return [::Google::Cloud::PubSub::V1::PushConfig::PubsubWrapper] + # Optional. When set, the payload to the push endpoint is in the form of + # the JSON representation of a PubsubMessage + # (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + # @!attribute [rw] no_wrapper + # @return [::Google::Cloud::PubSub::V1::PushConfig::NoWrapper] + # Optional. When set, the payload to the push endpoint is not wrapped. + class PushConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # @!attribute [rw] service_account_email + # @return [::String] + # Optional. [Service account + # email](https://cloud.google.com/iam/docs/service-accounts) + # used for generating the OIDC token. For more information + # on setting up authentication, see + # [Push subscriptions](https://cloud.google.com/pubsub/docs/push). + # @!attribute [rw] audience + # @return [::String] + # Optional. Audience to be used when generating OIDC token. The audience + # claim identifies the recipients that the JWT is intended for. The + # audience value is a single case-sensitive string. Having multiple values + # (array) for the audience field is not supported. More info about the OIDC + # JWT token audience here: + # https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, + # the Push endpoint URL will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The payload to the push endpoint is in the form of the JSON representation + # of a PubsubMessage + # (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). + class PubsubWrapper + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sets the `data` field as the HTTP body for delivery. + # @!attribute [rw] write_metadata + # @return [::Boolean] + # Optional. When true, writes the Pub/Sub message metadata to + # `x-goog-pubsub-:` headers of the HTTP request. Writes the + # Pub/Sub message attributes to `:` headers of the HTTP request. + class NoWrapper + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for a BigQuery subscription. + # @!attribute [rw] table + # @return [::String] + # Optional. The name of the table to which to write data, of the form + # \\{projectId}.\\{datasetId}.\\{tableId} + # @!attribute [rw] use_topic_schema + # @return [::Boolean] + # Optional. When true, use the topic's schema as the columns to write to in + # BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be + # enabled at the same time. + # @!attribute [rw] write_metadata + # @return [::Boolean] + # Optional. When true, write the subscription name, message_id, publish_time, + # attributes, and ordering_key to additional columns in the table. The + # subscription name, message_id, and publish_time fields are put in their own + # columns while all other message properties (other than data) are written to + # a JSON object in the attributes column. + # @!attribute [rw] drop_unknown_fields + # @return [::Boolean] + # Optional. When true and use_topic_schema is true, any fields that are a + # part of the topic schema that are not part of the BigQuery table schema are + # dropped when writing to BigQuery. Otherwise, the schemas must be kept in + # sync and any messages with extra fields are not written and remain in the + # subscription's backlog. + # @!attribute [r] state + # @return [::Google::Cloud::PubSub::V1::BigQueryConfig::State] + # Output only. An output-only field that indicates whether or not the + # subscription can receive messages. + # @!attribute [rw] use_table_schema + # @return [::Boolean] + # Optional. When true, use the BigQuery table's schema as the columns to + # write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be + # enabled at the same time. + # @!attribute [rw] service_account_email + # @return [::String] + # Optional. The service account to use to write to BigQuery. The subscription + # creator or updater that specifies this field must have + # `iam.serviceAccounts.actAs` permission on the service account. If not + # specified, the Pub/Sub [service + # agent](https://cloud.google.com/iam/docs/service-agents), + # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + class BigQueryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states for a BigQuery subscription. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # The subscription can actively send messages to BigQuery + ACTIVE = 1 + + # Cannot write to the BigQuery table because of permission denied errors. + # This can happen if + # - Pub/Sub SA has not been granted the [appropriate BigQuery IAM + # permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) + # - bigquery.googleapis.com API is not enabled for the project + # ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) + PERMISSION_DENIED = 2 + + # Cannot write to the BigQuery table because it does not exist. + NOT_FOUND = 3 + + # Cannot write to the BigQuery table due to a schema mismatch. + SCHEMA_MISMATCH = 4 + + # Cannot write to the destination because enforce_in_transit is set to true + # and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 5 + end + end + + # Configuration for a Cloud Storage subscription. + # @!attribute [rw] bucket + # @return [::String] + # Required. User-provided name for the Cloud Storage bucket. + # The bucket must be created by the user. The bucket name must be without + # any prefix like "gs://". See the [bucket naming + # requirements] (https://cloud.google.com/storage/docs/buckets#naming). + # @!attribute [rw] filename_prefix + # @return [::String] + # Optional. User-provided prefix for Cloud Storage filename. See the [object + # naming requirements](https://cloud.google.com/storage/docs/objects#naming). + # @!attribute [rw] filename_suffix + # @return [::String] + # Optional. User-provided suffix for Cloud Storage filename. See the [object + # naming requirements](https://cloud.google.com/storage/docs/objects#naming). + # Must not end in "/". + # @!attribute [rw] filename_datetime_format + # @return [::String] + # Optional. User-provided format string specifying how to represent datetimes + # in Cloud Storage filenames. See the [datetime format + # guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). + # @!attribute [rw] text_config + # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig::TextConfig] + # Optional. If set, message data will be written to Cloud Storage in text + # format. + # @!attribute [rw] avro_config + # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig::AvroConfig] + # Optional. If set, message data will be written to Cloud Storage in Avro + # format. + # @!attribute [rw] max_duration + # @return [::Google::Protobuf::Duration] + # Optional. The maximum duration that can elapse before a new Cloud Storage + # file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not + # exceed the subscription's acknowledgement deadline. + # @!attribute [rw] max_bytes + # @return [::Integer] + # Optional. The maximum bytes that can be written to a Cloud Storage file + # before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may + # be exceeded in cases where messages are larger than the limit. + # @!attribute [rw] max_messages + # @return [::Integer] + # Optional. The maximum number of messages that can be written to a Cloud + # Storage file before a new file is created. Min 1000 messages. + # @!attribute [r] state + # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig::State] + # Output only. An output-only field that indicates whether or not the + # subscription can receive messages. + # @!attribute [rw] service_account_email + # @return [::String] + # Optional. The service account to use to write to Cloud Storage. The + # subscription creator or updater that specifies this field must have + # `iam.serviceAccounts.actAs` permission on the service account. If not + # specified, the Pub/Sub + # [service agent](https://cloud.google.com/iam/docs/service-agents), + # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. + class CloudStorageConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for writing message data in text format. + # Message payloads will be written to files as raw text, separated by a + # newline. + class TextConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for writing message data in Avro format. + # Message payloads and metadata will be written to files as an Avro binary. + # @!attribute [rw] write_metadata + # @return [::Boolean] + # Optional. When true, write the subscription name, message_id, + # publish_time, attributes, and ordering_key as additional fields in the + # output. The subscription name, message_id, and publish_time fields are + # put in their own fields while all other message properties other than + # data (for example, an ordering_key, if present) are added as entries in + # the attributes map. + # @!attribute [rw] use_topic_schema + # @return [::Boolean] + # Optional. When true, the output Cloud Storage file will be serialized + # using the topic schema, if it exists. + class AvroConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible states for a Cloud Storage subscription. + module State + # Default value. This value is unused. + STATE_UNSPECIFIED = 0 + + # The subscription can actively send messages to Cloud Storage. + ACTIVE = 1 + + # Cannot write to the Cloud Storage bucket because of permission denied + # errors. + PERMISSION_DENIED = 2 + + # Cannot write to the Cloud Storage bucket because it does not exist. + NOT_FOUND = 3 + + # Cannot write to the destination because enforce_in_transit is set to true + # and the destination locations are not in the allowed regions. + IN_TRANSIT_LOCATION_RESTRICTION = 4 + + # Cannot write to the Cloud Storage bucket due to an incompatibility + # between the topic schema and subscription settings. + SCHEMA_MISMATCH = 5 + end + end + + # A message and its corresponding acknowledgment ID. + # @!attribute [rw] ack_id + # @return [::String] + # Optional. This ID can be used to acknowledge the received message. + # @!attribute [rw] message + # @return [::Google::Cloud::PubSub::V1::PubsubMessage] + # Optional. The message. + # @!attribute [rw] delivery_attempt + # @return [::Integer] + # Optional. The approximate number of times that Pub/Sub has attempted to + # deliver the associated message to a subscriber. + # + # More precisely, this is 1 + (number of NACKs) + + # (number of ack_deadline exceeds) for this message. + # + # A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline + # exceeds event is whenever a message is not acknowledged within + # ack_deadline. Note that ack_deadline is initially + # Subscription.ackDeadlineSeconds, but may get extended automatically by + # the client library. + # + # Upon the first delivery of a given message, `delivery_attempt` will have a + # value of 1. The value is calculated at best effort and is approximate. + # + # If a DeadLetterPolicy is not set on the subscription, this will be 0. + class ReceivedMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the GetSubscription method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The name of the subscription to get. + # Format is `projects/{project}/subscriptions/{sub}`. + class GetSubscriptionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the UpdateSubscription method. + # @!attribute [rw] subscription + # @return [::Google::Cloud::PubSub::V1::Subscription] + # Required. The updated subscription object. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Indicates which fields in the provided subscription to update. + # Must be specified and non-empty. + class UpdateSubscriptionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListSubscriptions` method. + # @!attribute [rw] project + # @return [::String] + # Required. The name of the project in which to list subscriptions. + # Format is `projects/{project-id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of subscriptions to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value returned by the last `ListSubscriptionsResponse`; + # indicates that this is a continuation of a prior `ListSubscriptions` call, + # and that the system should return the next page of data. + class ListSubscriptionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListSubscriptions` method. + # @!attribute [rw] subscriptions + # @return [::Array<::Google::Cloud::PubSub::V1::Subscription>] + # Optional. The subscriptions that match the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. If not empty, indicates that there may be more subscriptions that + # match the request; this value should be passed in a new + # `ListSubscriptionsRequest` to get more subscriptions. + class ListSubscriptionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the DeleteSubscription method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription to delete. + # Format is `projects/{project}/subscriptions/{sub}`. + class DeleteSubscriptionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the ModifyPushConfig method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The name of the subscription. + # Format is `projects/{project}/subscriptions/{sub}`. + # @!attribute [rw] push_config + # @return [::Google::Cloud::PubSub::V1::PushConfig] + # Required. The push configuration for future deliveries. + # + # An empty `pushConfig` indicates that the Pub/Sub system should + # stop pushing messages from the given subscription and allow + # messages to be pulled and acknowledged - effectively pausing + # the subscription if `Pull` or `StreamingPull` is not called. + class ModifyPushConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `Pull` method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription from which messages should be pulled. + # Format is `projects/{project}/subscriptions/{sub}`. + # @!attribute [rw] return_immediately + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. If this field set to true, the system will respond immediately + # even if it there are no messages available to return in the `Pull` + # response. Otherwise, the system may wait (for a bounded amount of time) + # until at least one message is available, rather than returning no messages. + # Warning: setting this field to `true` is discouraged because it adversely + # impacts the performance of `Pull` operations. We recommend that users do + # not set this field. + # @!attribute [rw] max_messages + # @return [::Integer] + # Required. The maximum number of messages to return for this request. Must + # be a positive integer. The Pub/Sub system may return fewer than the number + # specified. + class PullRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `Pull` method. + # @!attribute [rw] received_messages + # @return [::Array<::Google::Cloud::PubSub::V1::ReceivedMessage>] + # Optional. Received Pub/Sub messages. The list will be empty if there are no + # more messages available in the backlog, or if no messages could be returned + # before the request timeout. For JSON, the response can be entirely + # empty. The Pub/Sub system may return fewer than the `maxMessages` requested + # even if there are more messages available in the backlog. + class PullResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the ModifyAckDeadline method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The name of the subscription. + # Format is `projects/{project}/subscriptions/{sub}`. + # @!attribute [rw] ack_ids + # @return [::Array<::String>] + # Required. List of acknowledgment IDs. + # @!attribute [rw] ack_deadline_seconds + # @return [::Integer] + # Required. The new ack deadline with respect to the time this request was + # sent to the Pub/Sub system. For example, if the value is 10, the new ack + # deadline will expire 10 seconds after the `ModifyAckDeadline` call was + # made. Specifying zero might immediately make the message available for + # delivery to another subscriber client. This typically results in an + # increase in the rate of message redeliveries (that is, duplicates). + # The minimum deadline you can specify is 0 seconds. + # The maximum deadline you can specify in a single request is 600 seconds + # (10 minutes). + class ModifyAckDeadlineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the Acknowledge method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription whose message is being acknowledged. + # Format is `projects/{project}/subscriptions/{sub}`. + # @!attribute [rw] ack_ids + # @return [::Array<::String>] + # Required. The acknowledgment ID for the messages being acknowledged that + # was returned by the Pub/Sub system in the `Pull` response. Must not be + # empty. + class AcknowledgeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `StreamingPull` streaming RPC method. This request is used to + # establish the initial stream as well as to stream acknowledgements and ack + # deadline modifications from the client to the server. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription for which to initialize the new stream. This + # must be provided in the first request on the stream, and must not be set in + # subsequent requests from client to server. + # Format is `projects/{project}/subscriptions/{sub}`. + # @!attribute [rw] ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs for acknowledging previously received + # messages (received on this stream or a different stream). If an ack ID has + # expired, the corresponding message may be redelivered later. Acknowledging + # a message more than once will not result in an error. If the + # acknowledgement ID is malformed, the stream will be aborted with status + # `INVALID_ARGUMENT`. + # @!attribute [rw] modify_deadline_seconds + # @return [::Array<::Integer>] + # Optional. The list of new ack deadlines for the IDs listed in + # `modify_deadline_ack_ids`. The size of this list must be the same as the + # size of `modify_deadline_ack_ids`. If it differs the stream will be aborted + # with `INVALID_ARGUMENT`. Each element in this list is applied to the + # element in the same position in `modify_deadline_ack_ids`. The new ack + # deadline is with respect to the time this request was sent to the Pub/Sub + # system. Must be >= 0. For example, if the value is 10, the new ack deadline + # will expire 10 seconds after this request is received. If the value is 0, + # the message is immediately made available for another streaming or + # non-streaming pull request. If the value is < 0 (an error), the stream will + # be aborted with status `INVALID_ARGUMENT`. + # @!attribute [rw] modify_deadline_ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs whose deadline will be modified based + # on the corresponding element in `modify_deadline_seconds`. This field can + # be used to indicate that more time is needed to process a message by the + # subscriber, or to make the message available for redelivery if the + # processing was interrupted. + # @!attribute [rw] stream_ack_deadline_seconds + # @return [::Integer] + # Required. The ack deadline to use for the stream. This must be provided in + # the first request on the stream, but it can also be updated on subsequent + # requests from client to server. The minimum deadline you can specify is 10 + # seconds. The maximum deadline you can specify is 600 seconds (10 minutes). + # @!attribute [rw] client_id + # @return [::String] + # Optional. A unique identifier that is used to distinguish client instances + # from each other. Only needs to be provided on the initial request. When a + # stream disconnects and reconnects for the same stream, the client_id should + # be set to the same value so that state associated with the old stream can + # be transferred to the new stream. The same client_id should not be used for + # different client instances. + # @!attribute [rw] max_outstanding_messages + # @return [::Integer] + # Optional. Flow control settings for the maximum number of outstanding + # messages. When there are `max_outstanding_messages` currently sent to the + # streaming pull client that have not yet been acked or nacked, the server + # stops sending more messages. The sending of messages resumes once the + # number of outstanding messages is less than this value. If the value is + # <= 0, there is no limit to the number of outstanding messages. This + # property can only be set on the initial StreamingPullRequest. If it is set + # on a subsequent request, the stream will be aborted with status + # `INVALID_ARGUMENT`. + # @!attribute [rw] max_outstanding_bytes + # @return [::Integer] + # Optional. Flow control settings for the maximum number of outstanding + # bytes. When there are `max_outstanding_bytes` or more worth of messages + # currently sent to the streaming pull client that have not yet been acked or + # nacked, the server will stop sending more messages. The sending of messages + # resumes once the number of outstanding bytes is less than this value. If + # the value is <= 0, there is no limit to the number of outstanding bytes. + # This property can only be set on the initial StreamingPullRequest. If it is + # set on a subsequent request, the stream will be aborted with status + # `INVALID_ARGUMENT`. + class StreamingPullRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `StreamingPull` method. This response is used to stream + # messages from the server to the client. + # @!attribute [rw] received_messages + # @return [::Array<::Google::Cloud::PubSub::V1::ReceivedMessage>] + # Optional. Received Pub/Sub messages. This will not be empty. + # @!attribute [rw] acknowledge_confirmation + # @return [::Google::Cloud::PubSub::V1::StreamingPullResponse::AcknowledgeConfirmation] + # Optional. This field will only be set if `enable_exactly_once_delivery` is + # set to `true`. + # @!attribute [rw] modify_ack_deadline_confirmation + # @return [::Google::Cloud::PubSub::V1::StreamingPullResponse::ModifyAckDeadlineConfirmation] + # Optional. This field will only be set if `enable_exactly_once_delivery` is + # set to `true`. + # @!attribute [rw] subscription_properties + # @return [::Google::Cloud::PubSub::V1::StreamingPullResponse::SubscriptionProperties] + # Optional. Properties associated with this subscription. + class StreamingPullResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Acknowledgement IDs sent in one or more previous requests to acknowledge a + # previously received message. + # @!attribute [rw] ack_ids + # @return [::Array<::String>] + # Optional. Successfully processed acknowledgement IDs. + # @!attribute [rw] invalid_ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs that were malformed or whose + # acknowledgement deadline has expired. + # @!attribute [rw] unordered_ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs that were out of order. + # @!attribute [rw] temporary_failed_ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs that failed processing with + # temporary issues. + class AcknowledgeConfirmation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Acknowledgement IDs sent in one or more previous requests to modify the + # deadline for a specific message. + # @!attribute [rw] ack_ids + # @return [::Array<::String>] + # Optional. Successfully processed acknowledgement IDs. + # @!attribute [rw] invalid_ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs that were malformed or whose + # acknowledgement deadline has expired. + # @!attribute [rw] temporary_failed_ack_ids + # @return [::Array<::String>] + # Optional. List of acknowledgement IDs that failed processing with + # temporary issues. + class ModifyAckDeadlineConfirmation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Subscription properties sent as part of the response. + # @!attribute [rw] exactly_once_delivery_enabled + # @return [::Boolean] + # Optional. True iff exactly once delivery is enabled for this + # subscription. + # @!attribute [rw] message_ordering_enabled + # @return [::Boolean] + # Optional. True iff message ordering is enabled for this subscription. + class SubscriptionProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for the `CreateSnapshot` method. + # @!attribute [rw] name + # @return [::String] + # Required. User-provided name for this snapshot. If the name is not provided + # in the request, the server will assign a random name for this snapshot on + # the same project as the subscription. Note that for REST API requests, you + # must specify a name. See the [resource name + # rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). + # Format is `projects/{project}/snapshots/{snap}`. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription whose backlog the snapshot retains. + # Specifically, the created snapshot is guaranteed to retain: + # (a) The existing backlog on the subscription. More precisely, this is + # defined as the messages in the subscription's backlog that are + # unacknowledged upon the successful completion of the + # `CreateSnapshot` request; as well as: + # (b) Any messages published to the subscription's topic following the + # successful completion of the CreateSnapshot request. + # Format is `projects/{project}/subscriptions/{sub}`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. See [Creating and managing + # labels](https://cloud.google.com/pubsub/docs/labels). + class CreateSnapshotRequest + 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 + + # Request for the UpdateSnapshot method. + # @!attribute [rw] snapshot + # @return [::Google::Cloud::PubSub::V1::Snapshot] + # Required. The updated snapshot object. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Indicates which fields in the provided snapshot to update. + # Must be specified and non-empty. + class UpdateSnapshotRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A snapshot resource. Snapshots are used in + # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) + # operations, which allow you to manage message acknowledgments in bulk. That + # is, you can set the acknowledgment state of messages in an existing + # subscription to the state captured by a snapshot. + # @!attribute [rw] name + # @return [::String] + # Optional. The name of the snapshot. + # @!attribute [rw] topic + # @return [::String] + # Optional. The name of the topic from which this snapshot is retaining + # messages. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The snapshot is guaranteed to exist up until this time. + # A newly-created snapshot expires no later than 7 days from the time of its + # creation. Its exact lifetime is determined at creation by the existing + # backlog in the source subscription. Specifically, the lifetime of the + # snapshot is `7 days - (age of oldest unacked message in the subscription)`. + # For example, consider a subscription whose oldest unacked message is 3 days + # old. If a snapshot is created from this subscription, the snapshot -- which + # will always capture this 3-day-old backlog as long as the snapshot + # exists -- will expire in 4 days. The service will refuse to create a + # snapshot that would expire in less than 1 hour after creation. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. See [Creating and managing labels] + # (https://cloud.google.com/pubsub/docs/labels). + class Snapshot + 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 + + # Request for the GetSnapshot method. + # @!attribute [rw] snapshot + # @return [::String] + # Required. The name of the snapshot to get. + # Format is `projects/{project}/snapshots/{snap}`. + class GetSnapshotRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListSnapshots` method. + # @!attribute [rw] project + # @return [::String] + # Required. The name of the project in which to list snapshots. + # Format is `projects/{project-id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of snapshots to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The value returned by the last `ListSnapshotsResponse`; indicates + # that this is a continuation of a prior `ListSnapshots` call, and that the + # system should return the next page of data. + class ListSnapshotsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListSnapshots` method. + # @!attribute [rw] snapshots + # @return [::Array<::Google::Cloud::PubSub::V1::Snapshot>] + # Optional. The resulting snapshots. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. If not empty, indicates that there may be more snapshot that + # match the request; this value should be passed in a new + # `ListSnapshotsRequest`. + class ListSnapshotsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `DeleteSnapshot` method. + # @!attribute [rw] snapshot + # @return [::String] + # Required. The name of the snapshot to delete. + # Format is `projects/{project}/snapshots/{snap}`. + class DeleteSnapshotRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `Seek` method. + # @!attribute [rw] subscription + # @return [::String] + # Required. The subscription to affect. + # @!attribute [rw] time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time to seek to. + # Messages retained in the subscription that were published before this + # time are marked as acknowledged, and messages retained in the + # subscription that were published after this time are marked as + # unacknowledged. Note that this operation affects only those messages + # retained in the subscription (configured by the combination of + # `message_retention_duration` and `retain_acked_messages`). For example, + # if `time` corresponds to a point before the message retention + # window (or to a point before the system's notion of the subscription + # creation time), only retained messages will be marked as unacknowledged, + # and already-expunged messages will not be restored. + # @!attribute [rw] snapshot + # @return [::String] + # Optional. The snapshot to seek to. The snapshot's topic must be the same + # as that of the provided subscription. Format is + # `projects/{project}/snapshots/{snap}`. + class SeekRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `Seek` method (this response is empty). + class SeekResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb new file mode 100644 index 000000000000..11917ee55a99 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb @@ -0,0 +1,303 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module PubSub + module V1 + # A schema resource. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the schema. + # Format is `projects/{project}/schemas/{schema}`. + # @!attribute [rw] type + # @return [::Google::Cloud::PubSub::V1::Schema::Type] + # The type of the schema definition. + # @!attribute [rw] definition + # @return [::String] + # The definition of the schema. This should contain a string representing + # the full definition of the schema that is a valid schema definition of + # the type specified in `type`. + # @!attribute [r] revision_id + # @return [::String] + # Output only. Immutable. The revision ID of the schema. + # @!attribute [r] revision_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp that the revision was created. + class Schema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible schema definition types. + module Type + # Default value. This value is unused. + TYPE_UNSPECIFIED = 0 + + # A Protocol Buffer schema definition. + PROTOCOL_BUFFER = 1 + + # An Avro schema definition. + AVRO = 2 + end + end + + # Request for the CreateSchema method. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to create the schema. + # Format is `projects/{project-id}`. + # @!attribute [rw] schema + # @return [::Google::Cloud::PubSub::V1::Schema] + # Required. The schema object to create. + # + # This schema's `name` parameter is ignored. The schema object returned + # by CreateSchema will have a `name` made using the given `parent` and + # `schema_id`. + # @!attribute [rw] schema_id + # @return [::String] + # The ID to use for the schema, which will become the final component of + # the schema's resource name. + # + # See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for + # resource name constraints. + class CreateSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the GetSchema method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the schema to get. + # Format is `projects/{project}/schemas/{schema}`. + # @!attribute [rw] view + # @return [::Google::Cloud::PubSub::V1::SchemaView] + # The set of fields to return in the response. If not set, returns a Schema + # with all fields filled out. Set to `BASIC` to omit the `definition`. + class GetSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListSchemas` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to list schemas. + # Format is `projects/{project-id}`. + # @!attribute [rw] view + # @return [::Google::Cloud::PubSub::V1::SchemaView] + # The set of Schema fields to return in the response. If not set, returns + # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + # retrieve all fields. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of schemas to return. + # @!attribute [rw] page_token + # @return [::String] + # The value returned by the last `ListSchemasResponse`; indicates that + # this is a continuation of a prior `ListSchemas` call, and that the + # system should return the next page of data. + class ListSchemasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListSchemas` method. + # @!attribute [rw] schemas + # @return [::Array<::Google::Cloud::PubSub::V1::Schema>] + # The resulting schemas. + # @!attribute [rw] next_page_token + # @return [::String] + # If not empty, indicates that there may be more schemas that match the + # request; this value should be passed in a new `ListSchemasRequest`. + class ListSchemasResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListSchemaRevisions` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the schema to list revisions for. + # @!attribute [rw] view + # @return [::Google::Cloud::PubSub::V1::SchemaView] + # The set of Schema fields to return in the response. If not set, returns + # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to + # retrieve all fields. + # @!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 ListSchemaRevisions call. + # Provide this to retrieve the subsequent page. + class ListSchemaRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListSchemaRevisions` method. + # @!attribute [rw] schemas + # @return [::Array<::Google::Cloud::PubSub::V1::Schema>] + # The revisions of the schema. + # @!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 empty, there are no subsequent pages. + class ListSchemaRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for CommitSchema method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the schema we are revising. + # Format is `projects/{project}/schemas/{schema}`. + # @!attribute [rw] schema + # @return [::Google::Cloud::PubSub::V1::Schema] + # Required. The schema revision to commit. + class CommitSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `RollbackSchema` method. + # @!attribute [rw] name + # @return [::String] + # Required. The schema being rolled back with revision id. + # @!attribute [rw] revision_id + # @return [::String] + # Required. The revision ID to roll back to. + # It must be a revision of the same schema. + # + # Example: c7cfa2a8 + class RollbackSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `DeleteSchemaRevision` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the schema revision to be deleted, with a revision ID + # explicitly included. + # + # Example: `projects/123/schemas/my-schema@c7cfa2a8` + # @!attribute [rw] revision_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. This field is deprecated and should not be used for specifying + # the revision ID. The revision ID should be specified via the `name` + # parameter. + class DeleteSchemaRevisionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `DeleteSchema` method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the schema to delete. + # Format is `projects/{project}/schemas/{schema}`. + class DeleteSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ValidateSchema` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to validate schemas. + # Format is `projects/{project-id}`. + # @!attribute [rw] schema + # @return [::Google::Cloud::PubSub::V1::Schema] + # Required. The schema object to validate. + class ValidateSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ValidateSchema` method. + # Empty for now. + class ValidateSchemaResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ValidateMessage` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project in which to validate schemas. + # Format is `projects/{project-id}`. + # @!attribute [rw] name + # @return [::String] + # Name of the schema against which to validate. + # + # Format is `projects/{project}/schemas/{schema}`. + # @!attribute [rw] schema + # @return [::Google::Cloud::PubSub::V1::Schema] + # Ad-hoc schema against which to validate + # @!attribute [rw] message + # @return [::String] + # Message to validate against the provided `schema_spec`. + # @!attribute [rw] encoding + # @return [::Google::Cloud::PubSub::V1::Encoding] + # The encoding expected for messages + class ValidateMessageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ValidateMessage` method. + # Empty for now. + class ValidateMessageResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # View of Schema object fields to be returned by GetSchema and ListSchemas. + module SchemaView + # The default / unset value. + # The API will default to the BASIC view. + SCHEMA_VIEW_UNSPECIFIED = 0 + + # Include the name and type of the schema, but not the definition. + BASIC = 1 + + # Include all Schema object fields. + FULL = 2 + end + + # Possible encoding types for messages. + module Encoding + # Unspecified + ENCODING_UNSPECIFIED = 0 + + # JSON encoding + JSON = 1 + + # Binary encoding, as defined by the schema type. For some schema types, + # binary encoding may not be available. + BINARY = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..41c8c3a565cc --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-pubsub-v1/snippets/Gemfile new file mode 100644 index 000000000000..7ab8afb44fd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1", path: "../" +else + gem "google-cloud-pubsub-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-pubsub-v1/snippets/publisher/create_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb new file mode 100644 index 000000000000..8811984e8f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/create_topic.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 pubsub_v1_generated_Publisher_CreateTopic_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the create_topic call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#create_topic. +# +def create_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::Topic.new + + # Call the create_topic method. + result = client.create_topic request + + # The returned object is of type Google::Cloud::PubSub::V1::Topic. + p result +end +# [END pubsub_v1_generated_Publisher_CreateTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb new file mode 100644 index 000000000000..8792a92b75b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.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 pubsub_v1_generated_Publisher_DeleteTopic_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the delete_topic call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#delete_topic. +# +def delete_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteTopicRequest.new + + # Call the delete_topic method. + result = client.delete_topic request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_Publisher_DeleteTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb new file mode 100644 index 000000000000..dcc05f40ccb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.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 pubsub_v1_generated_Publisher_DetachSubscription_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the detach_subscription call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription. +# +def detach_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new + + # Call the detach_subscription method. + result = client.detach_subscription request + + # The returned object is of type Google::Cloud::PubSub::V1::DetachSubscriptionResponse. + p result +end +# [END pubsub_v1_generated_Publisher_DetachSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb new file mode 100644 index 000000000000..0579fd51b1eb --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.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 pubsub_v1_generated_Publisher_GetTopic_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the get_topic call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#get_topic. +# +def get_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetTopicRequest.new + + # Call the get_topic method. + result = client.get_topic request + + # The returned object is of type Google::Cloud::PubSub::V1::Topic. + p result +end +# [END pubsub_v1_generated_Publisher_GetTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb new file mode 100644 index 000000000000..7f4a911e41ec --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.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 pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_topic_snapshots call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots. +# +def list_topic_snapshots + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new + + # Call the list_topic_snapshots method. + result = client.list_topic_snapshots request + + # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse. + p result +end +# [END pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb new file mode 100644 index 000000000000..090f8923ff6b --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.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 pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_topic_subscriptions call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions. +# +def list_topic_subscriptions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new + + # Call the list_topic_subscriptions method. + result = client.list_topic_subscriptions request + + # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse. + p result +end +# [END pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb new file mode 100644 index 000000000000..bd88ac920eb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.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 pubsub_v1_generated_Publisher_ListTopics_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_topics call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#list_topics. +# +def list_topics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListTopicsRequest.new + + # Call the list_topics method. + result = client.list_topics request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PubSub::V1::Topic. + p item + end +end +# [END pubsub_v1_generated_Publisher_ListTopics_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.rb new file mode 100644 index 000000000000..5caab9b1b951 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.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 pubsub_v1_generated_Publisher_Publish_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the publish call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#publish. +# +def publish + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::PublishRequest.new + + # Call the publish method. + result = client.publish request + + # The returned object is of type Google::Cloud::PubSub::V1::PublishResponse. + p result +end +# [END pubsub_v1_generated_Publisher_Publish_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb new file mode 100644 index 000000000000..57c7befa74d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.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 pubsub_v1_generated_Publisher_UpdateTopic_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the update_topic call in the Publisher service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#update_topic. +# +def update_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::UpdateTopicRequest.new + + # Call the update_topic method. + result = client.update_topic request + + # The returned object is of type Google::Cloud::PubSub::V1::Topic. + p result +end +# [END pubsub_v1_generated_Publisher_UpdateTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.rb new file mode 100644 index 000000000000..a1bf37fbf92c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.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 pubsub_v1_generated_SchemaService_CommitSchema_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the commit_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#commit_schema. +# +def commit_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::CommitSchemaRequest.new + + # Call the commit_schema method. + result = client.commit_schema request + + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end +# [END pubsub_v1_generated_SchemaService_CommitSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb new file mode 100644 index 000000000000..db03e1cc57d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.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 pubsub_v1_generated_SchemaService_CreateSchema_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the create_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#create_schema. +# +def create_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::CreateSchemaRequest.new + + # Call the create_schema method. + result = client.create_schema request + + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end +# [END pubsub_v1_generated_SchemaService_CreateSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb new file mode 100644 index 000000000000..c37a135f996e --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.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 pubsub_v1_generated_SchemaService_DeleteSchema_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the delete_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema. +# +def delete_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSchemaRequest.new + + # Call the delete_schema method. + result = client.delete_schema request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.rb new file mode 100644 index 000000000000..34402151bf28 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.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 pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the delete_schema_revision call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema_revision. +# +def delete_schema_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.new + + # Call the delete_schema_revision method. + result = client.delete_schema_revision request + + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end +# [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb new file mode 100644 index 000000000000..f4034e461abe --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.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 pubsub_v1_generated_SchemaService_GetSchema_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the get_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#get_schema. +# +def get_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetSchemaRequest.new + + # Call the get_schema method. + result = client.get_schema request + + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end +# [END pubsub_v1_generated_SchemaService_GetSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_revisions.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_revisions.rb new file mode 100644 index 000000000000..8a880de9fb9d --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_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 pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_schema_revisions call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#list_schema_revisions. +# +def list_schema_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new + + # Call the list_schema_revisions method. + result = client.list_schema_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::PubSub::V1::Schema. + p item + end +end +# [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb new file mode 100644 index 000000000000..4842a318d8d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.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 pubsub_v1_generated_SchemaService_ListSchemas_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_schemas call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas. +# +def list_schemas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSchemasRequest.new + + # Call the list_schemas method. + result = client.list_schemas request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PubSub::V1::Schema. + p item + end +end +# [END pubsub_v1_generated_SchemaService_ListSchemas_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.rb new file mode 100644 index 000000000000..89e822f9bd86 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.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 pubsub_v1_generated_SchemaService_RollbackSchema_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the rollback_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#rollback_schema. +# +def rollback_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::RollbackSchemaRequest.new + + # Call the rollback_schema method. + result = client.rollback_schema request + + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end +# [END pubsub_v1_generated_SchemaService_RollbackSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb new file mode 100644 index 000000000000..3cc775cb8df8 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.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 pubsub_v1_generated_SchemaService_ValidateMessage_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the validate_message call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#validate_message. +# +def validate_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ValidateMessageRequest.new + + # Call the validate_message method. + result = client.validate_message request + + # The returned object is of type Google::Cloud::PubSub::V1::ValidateMessageResponse. + p result +end +# [END pubsub_v1_generated_SchemaService_ValidateMessage_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb new file mode 100644 index 000000000000..9160d01f865c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.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 pubsub_v1_generated_SchemaService_ValidateSchema_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the validate_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema. +# +def validate_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ValidateSchemaRequest.new + + # Call the validate_schema method. + result = client.validate_schema request + + # The returned object is of type Google::Cloud::PubSub::V1::ValidateSchemaResponse. + p result +end +# [END pubsub_v1_generated_SchemaService_ValidateSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json b/owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json new file mode 100644 index 000000000000..9d8449734f3c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json @@ -0,0 +1,1415 @@ +{ + "client_library": { + "name": "google-cloud-pubsub-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.pubsub.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "pubsub_v1_generated_SchemaService_CreateSchema_sync", + "title": "Snippet for the create_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#create_schema.", + "file": "schema_service/create_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_schema", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#create_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::CreateSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Schema", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "CreateSchema", + "full_name": "google.pubsub.v1.SchemaService.CreateSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_GetSchema_sync", + "title": "Snippet for the get_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#get_schema.", + "file": "schema_service/get_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_schema", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#get_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::GetSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Schema", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "GetSchema", + "full_name": "google.pubsub.v1.SchemaService.GetSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_ListSchemas_sync", + "title": "Snippet for the list_schemas call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas.", + "file": "schema_service/list_schemas.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_schemas", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListSchemasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListSchemasResponse", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "ListSchemas", + "full_name": "google.pubsub.v1.SchemaService.ListSchemas", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync", + "title": "Snippet for the list_schema_revisions call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#list_schema_revisions.", + "file": "schema_service/list_schema_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_schema_revisions", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#list_schema_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListSchemaRevisionsResponse", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "ListSchemaRevisions", + "full_name": "google.pubsub.v1.SchemaService.ListSchemaRevisions", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_CommitSchema_sync", + "title": "Snippet for the commit_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#commit_schema.", + "file": "schema_service/commit_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "commit_schema", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#commit_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::CommitSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Schema", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "CommitSchema", + "full_name": "google.pubsub.v1.SchemaService.CommitSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_RollbackSchema_sync", + "title": "Snippet for the rollback_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#rollback_schema.", + "file": "schema_service/rollback_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "rollback_schema", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#rollback_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::RollbackSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Schema", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "RollbackSchema", + "full_name": "google.pubsub.v1.SchemaService.RollbackSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync", + "title": "Snippet for the delete_schema_revision call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema_revision.", + "file": "schema_service/delete_schema_revision.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_schema_revision", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema_revision", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Schema", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "DeleteSchemaRevision", + "full_name": "google.pubsub.v1.SchemaService.DeleteSchemaRevision", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_DeleteSchema_sync", + "title": "Snippet for the delete_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema.", + "file": "schema_service/delete_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_schema", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::DeleteSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "DeleteSchema", + "full_name": "google.pubsub.v1.SchemaService.DeleteSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_ValidateSchema_sync", + "title": "Snippet for the validate_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema.", + "file": "schema_service/validate_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "validate_schema", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ValidateSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ValidateSchemaResponse", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "ValidateSchema", + "full_name": "google.pubsub.v1.SchemaService.ValidateSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_SchemaService_ValidateMessage_sync", + "title": "Snippet for the validate_message call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#validate_message.", + "file": "schema_service/validate_message.rb", + "language": "RUBY", + "client_method": { + "short_name": "validate_message", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#validate_message", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ValidateMessageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ValidateMessageResponse", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" + }, + "method": { + "short_name": "ValidateMessage", + "full_name": "google.pubsub.v1.SchemaService.ValidateMessage", + "service": { + "short_name": "SchemaService", + "full_name": "google.pubsub.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_CreateTopic_sync", + "title": "Snippet for the create_topic call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#create_topic.", + "file": "publisher/create_topic.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_topic", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#create_topic", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::Topic", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Topic", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "CreateTopic", + "full_name": "google.pubsub.v1.Publisher.CreateTopic", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_UpdateTopic_sync", + "title": "Snippet for the update_topic call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#update_topic.", + "file": "publisher/update_topic.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_topic", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#update_topic", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::UpdateTopicRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Topic", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "UpdateTopic", + "full_name": "google.pubsub.v1.Publisher.UpdateTopic", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_Publish_sync", + "title": "Snippet for the publish call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#publish.", + "file": "publisher/publish.rb", + "language": "RUBY", + "client_method": { + "short_name": "publish", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#publish", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::PublishRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::PublishResponse", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "Publish", + "full_name": "google.pubsub.v1.Publisher.Publish", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_GetTopic_sync", + "title": "Snippet for the get_topic call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#get_topic.", + "file": "publisher/get_topic.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_topic", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#get_topic", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::GetTopicRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Topic", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "GetTopic", + "full_name": "google.pubsub.v1.Publisher.GetTopic", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_ListTopics_sync", + "title": "Snippet for the list_topics call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#list_topics.", + "file": "publisher/list_topics.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_topics", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#list_topics", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListTopicsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListTopicsResponse", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "ListTopics", + "full_name": "google.pubsub.v1.Publisher.ListTopics", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync", + "title": "Snippet for the list_topic_subscriptions call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions.", + "file": "publisher/list_topic_subscriptions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_topic_subscriptions", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "ListTopicSubscriptions", + "full_name": "google.pubsub.v1.Publisher.ListTopicSubscriptions", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_ListTopicSnapshots_sync", + "title": "Snippet for the list_topic_snapshots call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots.", + "file": "publisher/list_topic_snapshots.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_topic_snapshots", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "ListTopicSnapshots", + "full_name": "google.pubsub.v1.Publisher.ListTopicSnapshots", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_DeleteTopic_sync", + "title": "Snippet for the delete_topic call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#delete_topic.", + "file": "publisher/delete_topic.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_topic", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#delete_topic", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::DeleteTopicRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "DeleteTopic", + "full_name": "google.pubsub.v1.Publisher.DeleteTopic", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Publisher_DetachSubscription_sync", + "title": "Snippet for the detach_subscription call in the Publisher service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription.", + "file": "publisher/detach_subscription.rb", + "language": "RUBY", + "client_method": { + "short_name": "detach_subscription", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::DetachSubscriptionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::DetachSubscriptionResponse", + "client": { + "short_name": "Publisher::Client", + "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" + }, + "method": { + "short_name": "DetachSubscription", + "full_name": "google.pubsub.v1.Publisher.DetachSubscription", + "service": { + "short_name": "Publisher", + "full_name": "google.pubsub.v1.Publisher" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_CreateSubscription_sync", + "title": "Snippet for the create_subscription call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription.", + "file": "subscriber/create_subscription.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_subscription", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::Subscription", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Subscription", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "CreateSubscription", + "full_name": "google.pubsub.v1.Subscriber.CreateSubscription", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_GetSubscription_sync", + "title": "Snippet for the get_subscription call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription.", + "file": "subscriber/get_subscription.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_subscription", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::GetSubscriptionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Subscription", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "GetSubscription", + "full_name": "google.pubsub.v1.Subscriber.GetSubscription", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_UpdateSubscription_sync", + "title": "Snippet for the update_subscription call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription.", + "file": "subscriber/update_subscription.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_subscription", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Subscription", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "UpdateSubscription", + "full_name": "google.pubsub.v1.Subscriber.UpdateSubscription", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_ListSubscriptions_sync", + "title": "Snippet for the list_subscriptions call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions.", + "file": "subscriber/list_subscriptions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_subscriptions", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListSubscriptionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListSubscriptionsResponse", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "ListSubscriptions", + "full_name": "google.pubsub.v1.Subscriber.ListSubscriptions", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_DeleteSubscription_sync", + "title": "Snippet for the delete_subscription call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription.", + "file": "subscriber/delete_subscription.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_subscription", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "DeleteSubscription", + "full_name": "google.pubsub.v1.Subscriber.DeleteSubscription", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync", + "title": "Snippet for the modify_ack_deadline call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline.", + "file": "subscriber/modify_ack_deadline.rb", + "language": "RUBY", + "client_method": { + "short_name": "modify_ack_deadline", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "ModifyAckDeadline", + "full_name": "google.pubsub.v1.Subscriber.ModifyAckDeadline", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_Acknowledge_sync", + "title": "Snippet for the acknowledge call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge.", + "file": "subscriber/acknowledge.rb", + "language": "RUBY", + "client_method": { + "short_name": "acknowledge", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::AcknowledgeRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "Acknowledge", + "full_name": "google.pubsub.v1.Subscriber.Acknowledge", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_Pull_sync", + "title": "Snippet for the pull call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#pull.", + "file": "subscriber/pull.rb", + "language": "RUBY", + "client_method": { + "short_name": "pull", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#pull", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::PullRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::PullResponse", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "Pull", + "full_name": "google.pubsub.v1.Subscriber.Pull", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_StreamingPull_sync", + "title": "Snippet for the streaming_pull call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull.", + "file": "subscriber/streaming_pull.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_pull", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::StreamingPullRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::StreamingPullResponse", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "StreamingPull", + "full_name": "google.pubsub.v1.Subscriber.StreamingPull", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_ModifyPushConfig_sync", + "title": "Snippet for the modify_push_config call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config.", + "file": "subscriber/modify_push_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "modify_push_config", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ModifyPushConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "ModifyPushConfig", + "full_name": "google.pubsub.v1.Subscriber.ModifyPushConfig", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_GetSnapshot_sync", + "title": "Snippet for the get_snapshot call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot.", + "file": "subscriber/get_snapshot.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_snapshot", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::GetSnapshotRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Snapshot", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "GetSnapshot", + "full_name": "google.pubsub.v1.Subscriber.GetSnapshot", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_ListSnapshots_sync", + "title": "Snippet for the list_snapshots call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots.", + "file": "subscriber/list_snapshots.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_snapshots", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::ListSnapshotsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::ListSnapshotsResponse", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "ListSnapshots", + "full_name": "google.pubsub.v1.Subscriber.ListSnapshots", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_CreateSnapshot_sync", + "title": "Snippet for the create_snapshot call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot.", + "file": "subscriber/create_snapshot.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_snapshot", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::CreateSnapshotRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Snapshot", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "CreateSnapshot", + "full_name": "google.pubsub.v1.Subscriber.CreateSnapshot", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_UpdateSnapshot_sync", + "title": "Snippet for the update_snapshot call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot.", + "file": "subscriber/update_snapshot.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_snapshot", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::UpdateSnapshotRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::Snapshot", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "UpdateSnapshot", + "full_name": "google.pubsub.v1.Subscriber.UpdateSnapshot", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_DeleteSnapshot_sync", + "title": "Snippet for the delete_snapshot call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot.", + "file": "subscriber/delete_snapshot.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_snapshot", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::DeleteSnapshotRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "DeleteSnapshot", + "full_name": "google.pubsub.v1.Subscriber.DeleteSnapshot", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "pubsub_v1_generated_Subscriber_Seek_sync", + "title": "Snippet for the seek call in the Subscriber service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#seek.", + "file": "subscriber/seek.rb", + "language": "RUBY", + "client_method": { + "short_name": "seek", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#seek", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::PubSub::V1::SeekRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::PubSub::V1::SeekResponse", + "client": { + "short_name": "Subscriber::Client", + "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" + }, + "method": { + "short_name": "Seek", + "full_name": "google.pubsub.v1.Subscriber.Seek", + "service": { + "short_name": "Subscriber", + "full_name": "google.pubsub.v1.Subscriber" + } + } + }, + "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-pubsub-v1/snippets/subscriber/acknowledge.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb new file mode 100644 index 000000000000..1fb519824031 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.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 pubsub_v1_generated_Subscriber_Acknowledge_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the acknowledge call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge. +# +def acknowledge + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new + + # Call the acknowledge method. + result = client.acknowledge request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_Subscriber_Acknowledge_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb new file mode 100644 index 000000000000..a25c79ac750b --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.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 pubsub_v1_generated_Subscriber_CreateSnapshot_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the create_snapshot call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot. +# +def create_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new + + # Call the create_snapshot method. + result = client.create_snapshot request + + # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + p result +end +# [END pubsub_v1_generated_Subscriber_CreateSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb new file mode 100644 index 000000000000..6b3cb1294739 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.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 pubsub_v1_generated_Subscriber_CreateSubscription_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the create_subscription call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription. +# +def create_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::Subscription.new + + # Call the create_subscription method. + result = client.create_subscription request + + # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + p result +end +# [END pubsub_v1_generated_Subscriber_CreateSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb new file mode 100644 index 000000000000..43449c44ba7a --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.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 pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the delete_snapshot call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot. +# +def delete_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new + + # Call the delete_snapshot method. + result = client.delete_snapshot request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb new file mode 100644 index 000000000000..6ef94c7aa27a --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.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 pubsub_v1_generated_Subscriber_DeleteSubscription_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the delete_subscription call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription. +# +def delete_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new + + # Call the delete_subscription method. + result = client.delete_subscription request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_Subscriber_DeleteSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb new file mode 100644 index 000000000000..51b63dff8e75 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.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 pubsub_v1_generated_Subscriber_GetSnapshot_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the get_snapshot call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot. +# +def get_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new + + # Call the get_snapshot method. + result = client.get_snapshot request + + # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + p result +end +# [END pubsub_v1_generated_Subscriber_GetSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb new file mode 100644 index 000000000000..c99685381eda --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.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 pubsub_v1_generated_Subscriber_GetSubscription_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the get_subscription call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription. +# +def get_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new + + # Call the get_subscription method. + result = client.get_subscription request + + # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + p result +end +# [END pubsub_v1_generated_Subscriber_GetSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb new file mode 100644 index 000000000000..9ee8b02af0a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.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 pubsub_v1_generated_Subscriber_ListSnapshots_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_snapshots call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots. +# +def list_snapshots + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new + + # Call the list_snapshots method. + result = client.list_snapshots request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot. + p item + end +end +# [END pubsub_v1_generated_Subscriber_ListSnapshots_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb new file mode 100644 index 000000000000..d13b2449f414 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.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 pubsub_v1_generated_Subscriber_ListSubscriptions_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the list_subscriptions call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions. +# +def list_subscriptions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new + + # Call the list_subscriptions method. + result = client.list_subscriptions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::PubSub::V1::Subscription. + p item + end +end +# [END pubsub_v1_generated_Subscriber_ListSubscriptions_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb new file mode 100644 index 000000000000..23298f534025 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.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 pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the modify_ack_deadline call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline. +# +def modify_ack_deadline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new + + # Call the modify_ack_deadline method. + result = client.modify_ack_deadline request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb new file mode 100644 index 000000000000..dad858850239 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.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 pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the modify_push_config call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config. +# +def modify_push_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new + + # Call the modify_push_config method. + result = client.modify_push_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.rb new file mode 100644 index 000000000000..3de44e085e5a --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.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 pubsub_v1_generated_Subscriber_Pull_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the pull call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#pull. +# +def pull + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::PullRequest.new + + # Call the pull method. + result = client.pull request + + # The returned object is of type Google::Cloud::PubSub::V1::PullResponse. + p result +end +# [END pubsub_v1_generated_Subscriber_Pull_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.rb new file mode 100644 index 000000000000..174ae99d732d --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.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 pubsub_v1_generated_Subscriber_Seek_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the seek call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#seek. +# +def seek + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::SeekRequest.new + + # Call the seek method. + result = client.seek request + + # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse. + p result +end +# [END pubsub_v1_generated_Subscriber_Seek_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb new file mode 100644 index 000000000000..3ecb1666a8a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.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! + +# [START pubsub_v1_generated_Subscriber_StreamingPull_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the streaming_pull call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull. +# +def streaming_pull + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_pull method to start streaming. + output = client.streaming_pull input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::PubSub::V1::StreamingPullRequest.new + input << Google::Cloud::PubSub::V1::StreamingPullRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::PubSub::V1::StreamingPullResponse + output.each do |current_response| + p current_response + end +end +# [END pubsub_v1_generated_Subscriber_StreamingPull_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb new file mode 100644 index 000000000000..b031ce613d1c --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.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 pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the update_snapshot call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot. +# +def update_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new + + # Call the update_snapshot method. + result = client.update_snapshot request + + # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + p result +end +# [END pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb new file mode 100644 index 000000000000..e4e8051bda1f --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.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 pubsub_v1_generated_Subscriber_UpdateSubscription_sync] +require "google/cloud/pubsub/v1" + +## +# Snippet for the update_subscription call in the Subscriber service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription. +# +def update_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new + + # Call the update_subscription method. + result = client.update_subscription request + + # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + p result +end +# [END pubsub_v1_generated_Subscriber_UpdateSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb new file mode 100644 index 000000000000..e1b49a53126e --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/pubsub/v1/publisher" + +class ::Google::Cloud::PubSub::V1::Publisher::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.schema_path project: "value0", schema: "value1" + assert_equal "projects/value0/schemas/value1", path + end + end + + def test_subscription_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.subscription_path project: "value0", subscription: "value1" + assert_equal "projects/value0/subscriptions/value1", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + + path = client.topic_path + assert_equal "_deleted-topic_", path + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb new file mode 100644 index 000000000000..7254556e89bf --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb @@ -0,0 +1,635 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/pubsub/v1/pubsub_pb" +require "google/pubsub/v1/pubsub_services_pb" +require "google/cloud/pubsub/v1/publisher" + +class ::Google::Cloud::PubSub::V1::Publisher::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_topic + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Topic.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + labels = {} + message_storage_policy = {} + kms_key_name = "hello world" + schema_settings = {} + satisfies_pzs = true + message_retention_duration = {} + state = :STATE_UNSPECIFIED + ingestion_data_source_settings = {} + + create_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_topic, name + assert_kind_of ::Google::Cloud::PubSub::V1::Topic, request + assert_equal "hello world", request["name"] + assert_equal({}, request["labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::MessageStoragePolicy), request["message_storage_policy"] + assert_equal "hello world", request["kms_key_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::SchemaSettings), request["schema_settings"] + assert_equal true, request["satisfies_pzs"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["message_retention_duration"] + assert_equal :STATE_UNSPECIFIED, request["state"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::IngestionDataSourceSettings), request["ingestion_data_source_settings"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_topic_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_topic({ name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_topic name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_topic ::Google::Cloud::PubSub::V1::Topic.new(name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_topic({ name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_topic(::Google::Cloud::PubSub::V1::Topic.new(name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_topic_client_stub.call_rpc_count + end + end + + def test_update_topic + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Topic.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + topic = {} + update_mask = {} + + update_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_topic, name + assert_kind_of ::Google::Cloud::PubSub::V1::UpdateTopicRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Topic), request["topic"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_topic_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_topic({ topic: topic, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_topic topic: topic, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_topic ::Google::Cloud::PubSub::V1::UpdateTopicRequest.new(topic: topic, 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_topic({ topic: topic, 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_topic(::Google::Cloud::PubSub::V1::UpdateTopicRequest.new(topic: topic, 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_topic_client_stub.call_rpc_count + end + end + + def test_publish + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::PublishResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + topic = "hello world" + messages = [{}] + + publish_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :publish, name + assert_kind_of ::Google::Cloud::PubSub::V1::PublishRequest, request + assert_equal "hello world", request["topic"] + assert_kind_of ::Google::Cloud::PubSub::V1::PubsubMessage, request["messages"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, publish_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.publish({ topic: topic, messages: messages }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.publish topic: topic, messages: messages do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.publish ::Google::Cloud::PubSub::V1::PublishRequest.new(topic: topic, messages: messages) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.publish({ topic: topic, messages: messages }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.publish(::Google::Cloud::PubSub::V1::PublishRequest.new(topic: topic, messages: messages), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, publish_client_stub.call_rpc_count + end + end + + def test_get_topic + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Topic.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + topic = "hello world" + + get_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_topic, name + assert_kind_of ::Google::Cloud::PubSub::V1::GetTopicRequest, request + assert_equal "hello world", request["topic"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_topic_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_topic({ topic: topic }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_topic topic: topic do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_topic ::Google::Cloud::PubSub::V1::GetTopicRequest.new(topic: topic) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_topic({ topic: topic }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_topic(::Google::Cloud::PubSub::V1::GetTopicRequest.new(topic: topic), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_topic_client_stub.call_rpc_count + end + end + + def test_list_topics + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListTopicsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + page_size = 42 + page_token = "hello world" + + list_topics_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_topics, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListTopicsRequest, request + assert_equal "hello world", request["project"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_topics_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_topics({ project: project, page_size: page_size, page_token: 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_topics project: project, page_size: page_size, page_token: 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_topics ::Google::Cloud::PubSub::V1::ListTopicsRequest.new(project: project, page_size: page_size, page_token: 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_topics({ project: project, 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_topics(::Google::Cloud::PubSub::V1::ListTopicsRequest.new(project: project, 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_topics_client_stub.call_rpc_count + end + end + + def test_list_topic_subscriptions + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + topic = "hello world" + page_size = 42 + page_token = "hello world" + + list_topic_subscriptions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_topic_subscriptions, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, request + assert_equal "hello world", request["topic"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_topic_subscriptions_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_topic_subscriptions({ topic: topic, page_size: page_size, page_token: page_token }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_topic_subscriptions topic: topic, page_size: page_size, page_token: page_token do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_topic_subscriptions ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new(topic: topic, page_size: page_size, page_token: page_token) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_topic_subscriptions({ topic: topic, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_topic_subscriptions(::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new(topic: topic, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_topic_subscriptions_client_stub.call_rpc_count + end + end + + def test_list_topic_snapshots + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + topic = "hello world" + page_size = 42 + page_token = "hello world" + + list_topic_snapshots_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_topic_snapshots, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, request + assert_equal "hello world", request["topic"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_topic_snapshots_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_topic_snapshots({ topic: topic, page_size: page_size, page_token: page_token }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_topic_snapshots topic: topic, page_size: page_size, page_token: page_token do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_topic_snapshots ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new(topic: topic, page_size: page_size, page_token: page_token) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_topic_snapshots({ topic: topic, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_topic_snapshots(::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new(topic: topic, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_topic_snapshots_client_stub.call_rpc_count + end + end + + def test_delete_topic + # 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. + topic = "hello world" + + delete_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_topic, name + assert_kind_of ::Google::Cloud::PubSub::V1::DeleteTopicRequest, request + assert_equal "hello world", request["topic"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_topic_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_topic({ topic: topic }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_topic topic: topic do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_topic ::Google::Cloud::PubSub::V1::DeleteTopicRequest.new(topic: topic) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_topic({ topic: topic }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_topic(::Google::Cloud::PubSub::V1::DeleteTopicRequest.new(topic: topic), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_topic_client_stub.call_rpc_count + end + end + + def test_detach_subscription + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + subscription = "hello world" + + detach_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :detach_subscription, name + assert_kind_of ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, request + assert_equal "hello world", request["subscription"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, detach_subscription_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.detach_subscription({ subscription: subscription }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.detach_subscription subscription: subscription do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.detach_subscription ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new(subscription: subscription) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.detach_subscription({ subscription: subscription }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.detach_subscription(::Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new(subscription: subscription), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, detach_subscription_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::PubSub::V1::Publisher::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::PubSub::V1::Publisher::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb new file mode 100644 index 000000000000..12a4779fa779 --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/pubsub/v1/schema_service" + +class ::Google::Cloud::PubSub::V1::SchemaService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.schema_path project: "value0", schema: "value1" + assert_equal "projects/value0/schemas/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb new file mode 100644 index 000000000000..fad97a2bdf6a --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/pubsub/v1/schema_pb" +require "google/pubsub/v1/schema_services_pb" +require "google/cloud/pubsub/v1/schema_service" + +class ::Google::Cloud::PubSub::V1::SchemaService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Schema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + schema = {} + schema_id = "hello world" + + create_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_schema, name + assert_kind_of ::Google::Cloud::PubSub::V1::CreateSchemaRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Schema), request["schema"] + assert_equal "hello world", request["schema_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_schema_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_schema parent: parent, schema: schema, schema_id: schema_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_schema ::Google::Cloud::PubSub::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_schema(::Google::Cloud::PubSub::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_schema_client_stub.call_rpc_count + end + end + + def test_get_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Schema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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 = :SCHEMA_VIEW_UNSPECIFIED + + get_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_schema, name + assert_kind_of ::Google::Cloud::PubSub::V1::GetSchemaRequest, request + assert_equal "hello world", request["name"] + assert_equal :SCHEMA_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_schema_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_schema({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_schema name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_schema ::Google::Cloud::PubSub::V1::GetSchemaRequest.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_schema({ 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_schema(::Google::Cloud::PubSub::V1::GetSchemaRequest.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_schema_client_stub.call_rpc_count + end + end + + def test_list_schemas + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListSchemasResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + view = :SCHEMA_VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_schemas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_schemas, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListSchemasRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SCHEMA_VIEW_UNSPECIFIED, request["view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_schemas_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_schemas({ parent: parent, view: 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_schemas parent: parent, view: 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_schemas ::Google::Cloud::PubSub::V1::ListSchemasRequest.new(parent: parent, view: 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_schemas({ parent: parent, view: 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_schemas(::Google::Cloud::PubSub::V1::ListSchemasRequest.new(parent: parent, view: 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_schemas_client_stub.call_rpc_count + end + end + + def test_list_schema_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListSchemaRevisionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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 = :SCHEMA_VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_schema_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_schema_revisions, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest, request + assert_equal "hello world", request["name"] + assert_equal :SCHEMA_VIEW_UNSPECIFIED, request["view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_schema_revisions_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_schema_revisions({ name: name, view: 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_schema_revisions name: name, view: 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_schema_revisions ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new(name: name, view: 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_schema_revisions({ name: name, view: 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_schema_revisions(::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new(name: name, view: 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_schema_revisions_client_stub.call_rpc_count + end + end + + def test_commit_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Schema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + schema = {} + + commit_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :commit_schema, name + assert_kind_of ::Google::Cloud::PubSub::V1::CommitSchemaRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Schema), request["schema"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, commit_schema_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.commit_schema({ name: name, schema: schema }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.commit_schema name: name, schema: schema do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.commit_schema ::Google::Cloud::PubSub::V1::CommitSchemaRequest.new(name: name, schema: schema) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.commit_schema({ name: name, schema: schema }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.commit_schema(::Google::Cloud::PubSub::V1::CommitSchemaRequest.new(name: name, schema: schema), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, commit_schema_client_stub.call_rpc_count + end + end + + def test_rollback_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Schema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rollback_schema, name + assert_kind_of ::Google::Cloud::PubSub::V1::RollbackSchemaRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["revision_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rollback_schema_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rollback_schema({ 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_schema 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_schema ::Google::Cloud::PubSub::V1::RollbackSchemaRequest.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_schema({ 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_schema(::Google::Cloud::PubSub::V1::RollbackSchemaRequest.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_schema_client_stub.call_rpc_count + end + end + + def test_delete_schema_revision + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Schema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + + delete_schema_revision_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_schema_revision, name + assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["revision_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_schema_revision_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_schema_revision({ name: name, revision_id: revision_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_schema_revision name: name, revision_id: revision_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_schema_revision ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.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.delete_schema_revision({ 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.delete_schema_revision(::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.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, delete_schema_revision_client_stub.call_rpc_count + end + end + + def test_delete_schema + # 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_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_schema, name + assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSchemaRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_schema_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_schema({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_schema name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_schema ::Google::Cloud::PubSub::V1::DeleteSchemaRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_schema({ 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_schema(::Google::Cloud::PubSub::V1::DeleteSchemaRequest.new(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_schema_client_stub.call_rpc_count + end + end + + def test_validate_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ValidateSchemaResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + schema = {} + + validate_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :validate_schema, name + assert_kind_of ::Google::Cloud::PubSub::V1::ValidateSchemaRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Schema), request["schema"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, validate_schema_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.validate_schema({ parent: parent, schema: schema }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.validate_schema parent: parent, schema: schema do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.validate_schema ::Google::Cloud::PubSub::V1::ValidateSchemaRequest.new(parent: parent, schema: schema) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.validate_schema({ parent: parent, schema: schema }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.validate_schema(::Google::Cloud::PubSub::V1::ValidateSchemaRequest.new(parent: parent, schema: schema), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, validate_schema_client_stub.call_rpc_count + end + end + + def test_validate_message + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ValidateMessageResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + name = "hello world" + message = "hello world" + encoding = :ENCODING_UNSPECIFIED + + validate_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :validate_message, name + assert_kind_of ::Google::Cloud::PubSub::V1::ValidateMessageRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["name"] + assert_equal :name, request.schema_spec + assert_equal "hello world", request["message"] + assert_equal :ENCODING_UNSPECIFIED, request["encoding"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, validate_message_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.validate_message({ parent: parent, name: name, message: message, encoding: encoding }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.validate_message parent: parent, name: name, message: message, encoding: encoding do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.validate_message ::Google::Cloud::PubSub::V1::ValidateMessageRequest.new(parent: parent, name: name, message: message, encoding: encoding) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.validate_message({ parent: parent, name: name, message: message, encoding: encoding }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.validate_message(::Google::Cloud::PubSub::V1::ValidateMessageRequest.new(parent: parent, name: name, message: message, encoding: encoding), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, validate_message_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::PubSub::V1::SchemaService::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::PubSub::V1::SchemaService::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb new file mode 100644 index 000000000000..fd533a166edb --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/pubsub/v1/subscriber" + +class ::Google::Cloud::PubSub::V1::Subscriber::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_snapshot_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.snapshot_path project: "value0", snapshot: "value1" + assert_equal "projects/value0/snapshots/value1", path + end + end + + def test_subscription_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.subscription_path project: "value0", subscription: "value1" + assert_equal "projects/value0/subscriptions/value1", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + + path = client.topic_path + assert_equal "_deleted-topic_", path + end + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb new file mode 100644 index 000000000000..81627bbb9f3f --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb @@ -0,0 +1,1123 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/pubsub/v1/pubsub_pb" +require "google/pubsub/v1/pubsub_services_pb" +require "google/cloud/pubsub/v1/subscriber" + +class ::Google::Cloud::PubSub::V1::Subscriber::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_subscription + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Subscription.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + topic = "hello world" + push_config = {} + bigquery_config = {} + cloud_storage_config = {} + ack_deadline_seconds = 42 + retain_acked_messages = true + message_retention_duration = {} + labels = {} + enable_message_ordering = true + expiration_policy = {} + filter = "hello world" + dead_letter_policy = {} + retry_policy = {} + detached = true + enable_exactly_once_delivery = true + topic_message_retention_duration = {} + state = :STATE_UNSPECIFIED + + create_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_subscription, name + assert_kind_of ::Google::Cloud::PubSub::V1::Subscription, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["topic"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::PushConfig), request["push_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::BigQueryConfig), request["bigquery_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::CloudStorageConfig), request["cloud_storage_config"] + assert_equal 42, request["ack_deadline_seconds"] + assert_equal true, request["retain_acked_messages"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["message_retention_duration"] + assert_equal({}, request["labels"].to_h) + assert_equal true, request["enable_message_ordering"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::ExpirationPolicy), request["expiration_policy"] + assert_equal "hello world", request["filter"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::DeadLetterPolicy), request["dead_letter_policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::RetryPolicy), request["retry_policy"] + assert_equal true, request["detached"] + assert_equal true, request["enable_exactly_once_delivery"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["topic_message_retention_duration"] + assert_equal :STATE_UNSPECIFIED, request["state"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_subscription_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_subscription({ name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_subscription name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_subscription ::Google::Cloud::PubSub::V1::Subscription.new(name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_subscription({ name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_subscription(::Google::Cloud::PubSub::V1::Subscription.new(name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_subscription_client_stub.call_rpc_count + end + end + + def test_get_subscription + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Subscription.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + subscription = "hello world" + + get_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_subscription, name + assert_kind_of ::Google::Cloud::PubSub::V1::GetSubscriptionRequest, request + assert_equal "hello world", request["subscription"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_subscription_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_subscription({ subscription: subscription }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_subscription subscription: subscription do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_subscription ::Google::Cloud::PubSub::V1::GetSubscriptionRequest.new(subscription: subscription) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_subscription({ subscription: subscription }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_subscription(::Google::Cloud::PubSub::V1::GetSubscriptionRequest.new(subscription: subscription), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_subscription_client_stub.call_rpc_count + end + end + + def test_update_subscription + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Subscription.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + subscription = {} + update_mask = {} + + update_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_subscription, name + assert_kind_of ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Subscription), request["subscription"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_subscription_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_subscription({ subscription: subscription, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_subscription subscription: subscription, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_subscription ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new(subscription: subscription, 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_subscription({ subscription: subscription, 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_subscription(::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new(subscription: subscription, 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_subscription_client_stub.call_rpc_count + end + end + + def test_list_subscriptions + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListSubscriptionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + page_size = 42 + page_token = "hello world" + + list_subscriptions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_subscriptions, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, request + assert_equal "hello world", request["project"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_subscriptions_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_subscriptions({ project: project, page_size: page_size, page_token: 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_subscriptions project: project, page_size: page_size, page_token: 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_subscriptions ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new(project: project, page_size: page_size, page_token: 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_subscriptions({ project: project, 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_subscriptions(::Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new(project: project, 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_subscriptions_client_stub.call_rpc_count + end + end + + def test_delete_subscription + # 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. + subscription = "hello world" + + delete_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_subscription, name + assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, request + assert_equal "hello world", request["subscription"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_subscription_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_subscription({ subscription: subscription }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_subscription subscription: subscription do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_subscription ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new(subscription: subscription) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_subscription({ subscription: subscription }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_subscription(::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new(subscription: subscription), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_subscription_client_stub.call_rpc_count + end + end + + def test_modify_ack_deadline + # 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. + subscription = "hello world" + ack_ids = ["hello world"] + ack_deadline_seconds = 42 + + modify_ack_deadline_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :modify_ack_deadline, name + assert_kind_of ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, request + assert_equal "hello world", request["subscription"] + assert_equal ["hello world"], request["ack_ids"] + assert_equal 42, request["ack_deadline_seconds"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, modify_ack_deadline_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.modify_ack_deadline({ subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.modify_ack_deadline subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.modify_ack_deadline ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new(subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.modify_ack_deadline({ subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.modify_ack_deadline(::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new(subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, modify_ack_deadline_client_stub.call_rpc_count + end + end + + def test_acknowledge + # 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. + subscription = "hello world" + ack_ids = ["hello world"] + + acknowledge_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :acknowledge, name + assert_kind_of ::Google::Cloud::PubSub::V1::AcknowledgeRequest, request + assert_equal "hello world", request["subscription"] + assert_equal ["hello world"], request["ack_ids"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, acknowledge_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.acknowledge({ subscription: subscription, ack_ids: ack_ids }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.acknowledge subscription: subscription, ack_ids: ack_ids do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.acknowledge ::Google::Cloud::PubSub::V1::AcknowledgeRequest.new(subscription: subscription, ack_ids: ack_ids) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.acknowledge({ subscription: subscription, ack_ids: ack_ids }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.acknowledge(::Google::Cloud::PubSub::V1::AcknowledgeRequest.new(subscription: subscription, ack_ids: ack_ids), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, acknowledge_client_stub.call_rpc_count + end + end + + def test_pull + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::PullResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + subscription = "hello world" + return_immediately = true + max_messages = 42 + + pull_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pull, name + assert_kind_of ::Google::Cloud::PubSub::V1::PullRequest, request + assert_equal "hello world", request["subscription"] + assert_equal true, request["return_immediately"] + assert_equal 42, request["max_messages"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pull_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pull({ subscription: subscription, return_immediately: return_immediately, max_messages: max_messages }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pull subscription: subscription, return_immediately: return_immediately, max_messages: max_messages do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pull ::Google::Cloud::PubSub::V1::PullRequest.new(subscription: subscription, return_immediately: return_immediately, max_messages: max_messages) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pull({ subscription: subscription, return_immediately: return_immediately, max_messages: max_messages }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pull(::Google::Cloud::PubSub::V1::PullRequest.new(subscription: subscription, return_immediately: return_immediately, max_messages: max_messages), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, pull_client_stub.call_rpc_count + end + end + + def test_streaming_pull + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::StreamingPullResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a bidi streaming method. + subscription = "hello world" + ack_ids = ["hello world"] + modify_deadline_seconds = [42] + modify_deadline_ack_ids = ["hello world"] + stream_ack_deadline_seconds = 42 + client_id = "hello world" + max_outstanding_messages = 42 + max_outstanding_bytes = 42 + + streaming_pull_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_pull, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_pull_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } + request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes + enum_input = [request_hash, request_proto].to_enum + client.streaming_pull enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } + request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes + stream_input = Gapic::StreamInput.new + client.streaming_pull stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } + request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes + enum_input = [request_hash, request_proto].to_enum + client.streaming_pull enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } + request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes + stream_input = Gapic::StreamInput.new + client.streaming_pull stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_pull_client_stub.call_rpc_count + streaming_pull_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullRequest, r + assert_equal "hello world", r["subscription"] + assert_equal ["hello world"], r["ack_ids"] + assert_equal [42], r["modify_deadline_seconds"] + assert_equal ["hello world"], r["modify_deadline_ack_ids"] + assert_equal 42, r["stream_ack_deadline_seconds"] + assert_equal "hello world", r["client_id"] + assert_equal 42, r["max_outstanding_messages"] + assert_equal 42, r["max_outstanding_bytes"] + end + end + end + end + + def test_modify_push_config + # 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. + subscription = "hello world" + push_config = {} + + modify_push_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :modify_push_config, name + assert_kind_of ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, request + assert_equal "hello world", request["subscription"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::PushConfig), request["push_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, modify_push_config_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.modify_push_config({ subscription: subscription, push_config: push_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.modify_push_config subscription: subscription, push_config: push_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.modify_push_config ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new(subscription: subscription, push_config: push_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.modify_push_config({ subscription: subscription, push_config: push_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.modify_push_config(::Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new(subscription: subscription, push_config: push_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, modify_push_config_client_stub.call_rpc_count + end + end + + def test_get_snapshot + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Snapshot.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + snapshot = "hello world" + + get_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_snapshot, name + assert_kind_of ::Google::Cloud::PubSub::V1::GetSnapshotRequest, request + assert_equal "hello world", request["snapshot"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_snapshot_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_snapshot({ snapshot: snapshot }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_snapshot snapshot: snapshot do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_snapshot ::Google::Cloud::PubSub::V1::GetSnapshotRequest.new(snapshot: snapshot) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_snapshot({ snapshot: snapshot }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_snapshot(::Google::Cloud::PubSub::V1::GetSnapshotRequest.new(snapshot: snapshot), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_snapshot_client_stub.call_rpc_count + end + end + + def test_list_snapshots + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::ListSnapshotsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + page_size = 42 + page_token = "hello world" + + list_snapshots_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_snapshots, name + assert_kind_of ::Google::Cloud::PubSub::V1::ListSnapshotsRequest, request + assert_equal "hello world", request["project"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_snapshots_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_snapshots({ project: project, page_size: page_size, page_token: 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_snapshots project: project, page_size: page_size, page_token: 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_snapshots ::Google::Cloud::PubSub::V1::ListSnapshotsRequest.new(project: project, page_size: page_size, page_token: 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_snapshots({ project: project, 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_snapshots(::Google::Cloud::PubSub::V1::ListSnapshotsRequest.new(project: project, 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_snapshots_client_stub.call_rpc_count + end + end + + def test_create_snapshot + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Snapshot.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + subscription = "hello world" + labels = {} + + create_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_snapshot, name + assert_kind_of ::Google::Cloud::PubSub::V1::CreateSnapshotRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["subscription"] + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_snapshot_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_snapshot({ name: name, subscription: subscription, labels: labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_snapshot name: name, subscription: subscription, labels: labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_snapshot ::Google::Cloud::PubSub::V1::CreateSnapshotRequest.new(name: name, subscription: subscription, labels: labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_snapshot({ name: name, subscription: subscription, labels: labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_snapshot(::Google::Cloud::PubSub::V1::CreateSnapshotRequest.new(name: name, subscription: subscription, labels: labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_snapshot_client_stub.call_rpc_count + end + end + + def test_update_snapshot + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::Snapshot.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + snapshot = {} + update_mask = {} + + update_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_snapshot, name + assert_kind_of ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Snapshot), request["snapshot"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_snapshot_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_snapshot({ snapshot: snapshot, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_snapshot snapshot: snapshot, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_snapshot ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new(snapshot: snapshot, 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_snapshot({ snapshot: snapshot, 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_snapshot(::Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new(snapshot: snapshot, 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_snapshot_client_stub.call_rpc_count + end + end + + def test_delete_snapshot + # 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. + snapshot = "hello world" + + delete_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_snapshot, name + assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, request + assert_equal "hello world", request["snapshot"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_snapshot_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_snapshot({ snapshot: snapshot }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_snapshot snapshot: snapshot do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_snapshot ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new(snapshot: snapshot) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_snapshot({ snapshot: snapshot }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_snapshot(::Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new(snapshot: snapshot), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_snapshot_client_stub.call_rpc_count + end + end + + def test_seek + # Create GRPC objects. + grpc_response = ::Google::Cloud::PubSub::V1::SeekResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + subscription = "hello world" + time = {} + + seek_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :seek, name + assert_kind_of ::Google::Cloud::PubSub::V1::SeekRequest, request + assert_equal "hello world", request["subscription"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["time"] + assert_equal :time, request.target + refute_nil options + end + + Gapic::ServiceStub.stub :new, seek_client_stub do + # Create client + client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.seek({ subscription: subscription, time: time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.seek subscription: subscription, time: time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.seek ::Google::Cloud::PubSub::V1::SeekRequest.new(subscription: subscription, time: time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.seek({ subscription: subscription, time: time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.seek(::Google::Cloud::PubSub::V1::SeekRequest.new(subscription: subscription, time: time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, seek_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::PubSub::V1::Subscriber::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::PubSub::V1::Subscriber::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From fcf27e3c151a6cc719cfaa8a250d15bb73b2bacc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 10 Sep 2024 20:59:17 +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 --- .../cloud/pubsub/v1/subscriber/client.rb | 2 +- .../proto_docs/google/pubsub/v1/pubsub.rb | 2 +- .../google-cloud-pubsub-v1/.gitignore | 22 - .../.repo-metadata.json | 20 - .../google-cloud-pubsub-v1/.rubocop.yml | 33 - .../google-cloud-pubsub-v1/.toys.rb | 28 - .../google-cloud-pubsub-v1/.yardopts | 12 - .../google-cloud-pubsub-v1/AUTHENTICATION.md | 122 - .../google-cloud-pubsub-v1/CHANGELOG.md | 2 - .../google-cloud-pubsub-v1/Gemfile | 11 - .../google-cloud-pubsub-v1/LICENSE.md | 201 -- .../google-cloud-pubsub-v1/README.md | 144 -- .../google-cloud-pubsub-v1/Rakefile | 169 -- .../gapic_metadata.json | 211 -- .../google-cloud-pubsub-v1.gemspec | 29 - .../lib/google-cloud-pubsub-v1.rb | 21 - .../lib/google/cloud/pubsub/v1.rb | 42 - .../lib/google/cloud/pubsub/v1/publisher.rb | 50 - .../cloud/pubsub/v1/publisher/client.rb | 1316 ---------- .../cloud/pubsub/v1/publisher/credentials.rb | 52 - .../google/cloud/pubsub/v1/publisher/paths.rb | 115 - .../google/cloud/pubsub/v1/schema_service.rb | 49 - .../cloud/pubsub/v1/schema_service/client.rb | 1404 ----------- .../pubsub/v1/schema_service/credentials.rb | 52 - .../cloud/pubsub/v1/schema_service/paths.rb | 64 - .../lib/google/cloud/pubsub/v1/subscriber.rb | 51 - .../cloud/pubsub/v1/subscriber/client.rb | 2206 ----------------- .../cloud/pubsub/v1/subscriber/credentials.rb | 52 - .../cloud/pubsub/v1/subscriber/paths.rb | 115 - .../lib/google/cloud/pubsub/v1/version.rb | 28 - .../lib/google/pubsub/v1/pubsub_pb.rb | 115 - .../google/pubsub/v1/pubsub_services_pb.rb | 203 -- .../lib/google/pubsub/v1/schema_pb.rb | 67 - .../google/pubsub/v1/schema_services_pb.rb | 63 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 420 ---- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../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/pubsub/v1/pubsub.rb | 1489 ----------- .../proto_docs/google/pubsub/v1/schema.rb | 303 --- .../proto_docs/google/type/expr.rb | 75 - .../google-cloud-pubsub-v1/snippets/Gemfile | 32 - .../snippets/publisher/create_topic.rb | 47 - .../snippets/publisher/delete_topic.rb | 47 - .../snippets/publisher/detach_subscription.rb | 47 - .../snippets/publisher/get_topic.rb | 47 - .../publisher/list_topic_snapshots.rb | 47 - .../publisher/list_topic_subscriptions.rb | 47 - .../snippets/publisher/list_topics.rb | 51 - .../snippets/publisher/publish.rb | 47 - .../snippets/publisher/update_topic.rb | 47 - .../snippets/schema_service/commit_schema.rb | 47 - .../snippets/schema_service/create_schema.rb | 47 - .../snippets/schema_service/delete_schema.rb | 47 - .../schema_service/delete_schema_revision.rb | 47 - .../snippets/schema_service/get_schema.rb | 47 - .../schema_service/list_schema_revisions.rb | 51 - .../snippets/schema_service/list_schemas.rb | 51 - .../schema_service/rollback_schema.rb | 47 - .../schema_service/validate_message.rb | 47 - .../schema_service/validate_schema.rb | 47 - .../snippet_metadata_google.pubsub.v1.json | 1415 ----------- .../snippets/subscriber/acknowledge.rb | 47 - .../snippets/subscriber/create_snapshot.rb | 47 - .../subscriber/create_subscription.rb | 47 - .../snippets/subscriber/delete_snapshot.rb | 47 - .../subscriber/delete_subscription.rb | 47 - .../snippets/subscriber/get_snapshot.rb | 47 - .../snippets/subscriber/get_subscription.rb | 47 - .../snippets/subscriber/list_snapshots.rb | 51 - .../snippets/subscriber/list_subscriptions.rb | 51 - .../subscriber/modify_ack_deadline.rb | 47 - .../snippets/subscriber/modify_push_config.rb | 47 - .../snippets/subscriber/pull.rb | 47 - .../snippets/subscriber/seek.rb | 47 - .../snippets/subscriber/streaming_pull.rb | 56 - .../snippets/subscriber/update_snapshot.rb | 47 - .../subscriber/update_subscription.rb | 47 - .../cloud/pubsub/v1/publisher_paths_test.rb | 86 - .../google/cloud/pubsub/v1/publisher_test.rb | 635 ----- .../pubsub/v1/schema_service_paths_test.rb | 59 - .../cloud/pubsub/v1/schema_service_test.rb | 699 ------ .../cloud/pubsub/v1/subscriber_paths_test.rb | 86 - .../google/cloud/pubsub/v1/subscriber_test.rb | 1123 --------- .../google-cloud-pubsub-v1/test/helper.rb | 25 - 90 files changed, 2 insertions(+), 16067 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-v1.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_revisions.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb delete mode 100644 owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb diff --git a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb index ff00e5aa07b3..57686fc9eb9b 100644 --- a/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb +++ b/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb @@ -341,7 +341,7 @@ def initialize # backlog, from the moment a message is published. If `retain_acked_messages` # is true, then this also configures the retention of acknowledged messages, # and thus configures how far back in time a `Seek` can be done. Defaults to - # 7 days. Cannot be more than 7 days or less than 10 minutes. + # 7 days. Cannot be more than 31 days or less than 10 minutes. # @param labels [::Hash{::String => ::String}] # Optional. See [Creating and managing # labels](https://cloud.google.com/pubsub/docs/labels). diff --git a/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb b/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb index 86be4dc763d2..f63dfd14f608 100644 --- a/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb +++ b/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb @@ -500,7 +500,7 @@ class DetachSubscriptionResponse # backlog, from the moment a message is published. If `retain_acked_messages` # is true, then this also configures the retention of acknowledged messages, # and thus configures how far back in time a `Seek` can be done. Defaults to - # 7 days. Cannot be more than 7 days or less than 10 minutes. + # 7 days. Cannot be more than 31 days or less than 10 minutes. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Optional. See [Creating and managing diff --git a/owl-bot-staging/google-cloud-pubsub-v1/.gitignore b/owl-bot-staging/google-cloud-pubsub-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-pubsub-v1/.repo-metadata.json deleted file mode 100644 index f62e8968e887..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/.repo-metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "api_id": "pubsub.googleapis.com", - "api_shortname": "pubsub", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest", - "distribution_name": "google-cloud-pubsub-v1", - "is_cloud": true, - "language": "ruby", - "name": "pubsub", - "name_pretty": "Cloud Pub/Sub V1 API", - "product_documentation": "https://cloud.google.com/pubsub", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. Note that google-cloud-pubsub-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-pubsub instead. See the readme for more details.", - "ruby-cloud-env-prefix": "PUBSUB", - "ruby-cloud-product-url": "https://cloud.google.com/pubsub", - "ruby-cloud-path-override": "pub_sub=pubsub", - "ruby-cloud-namespace-override": "Pubsub=PubSub", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml b/owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml deleted file mode 100644 index 3c1a114c840b..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-pubsub-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-pubsub-v1.rb" diff --git a/owl-bot-staging/google-cloud-pubsub-v1/.toys.rb b/owl-bot-staging/google-cloud-pubsub-v1/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/.yardopts b/owl-bot-staging/google-cloud-pubsub-v1/.yardopts deleted file mode 100644 index 9db0d6df2152..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Pub/Sub 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-pubsub-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-pubsub-v1/AUTHENTICATION.md deleted file mode 100644 index 335305c07699..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-pubsub-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-pubsub-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/pubsub/v1" - -client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/pubsub/v1" - -::Google::Cloud::PubSub::V1::SchemaService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::PubSub::V1::SchemaService::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-pubsub-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/pubsub/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::PubSub::V1::SchemaService::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-pubsub-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-pubsub-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-pubsub-v1/Gemfile b/owl-bot-staging/google-cloud-pubsub-v1/Gemfile deleted file mode 100644 index 95163a6d11f8..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.27.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-pubsub-v1/LICENSE.md b/owl-bot-staging/google-cloud-pubsub-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/README.md b/owl-bot-staging/google-cloud-pubsub-v1/README.md deleted file mode 100644 index 120afb758a06..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Cloud Pub/Sub V1 API - -Provides reliable, many-to-many, asynchronous messaging between applications. - -Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. - -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 Pub/Sub V1 API. Most users should consider using -the main client gem, -[google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-pubsub-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/pubsub.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/pubsub/v1" - -client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new -request = ::Google::Cloud::PubSub::V1::CreateSchemaRequest.new # (request fields as keyword arguments...) -response = client.create_schema request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-pubsub-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/pubsub) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.7+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-pubsub`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-pubsub-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-pubsub`. -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-pubsub-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-pubsub-v1/Rakefile b/owl-bot-staging/google-cloud-pubsub-v1/Rakefile deleted file mode 100644 index 86a4aeb64aba..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-pubsub-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["PUBSUB_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["PUBSUB_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["PUBSUB_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 PUBSUB_TEST_PROJECT=test123 PUBSUB_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/pubsub/v1/schema_service/credentials" - ::Google::Cloud::PubSub::V1::SchemaService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["PUBSUB_PROJECT"] = project - ENV["PUBSUB_TEST_PROJECT"] = project - ENV["PUBSUB_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-pubsub-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-pubsub-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-pubsub-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-pubsub-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-pubsub-v1" - header "google-cloud-pubsub-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-pubsub-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-pubsub-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-pubsub-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-pubsub-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-pubsub-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-pubsub-v1/gapic_metadata.json deleted file mode 100644 index c83bd1885f2c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/gapic_metadata.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.pubsub.v1", - "libraryPackage": "::Google::Cloud::PubSub::V1", - "services": { - "SchemaService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::PubSub::V1::SchemaService::Client", - "rpcs": { - "CreateSchema": { - "methods": [ - "create_schema" - ] - }, - "GetSchema": { - "methods": [ - "get_schema" - ] - }, - "ListSchemas": { - "methods": [ - "list_schemas" - ] - }, - "ListSchemaRevisions": { - "methods": [ - "list_schema_revisions" - ] - }, - "CommitSchema": { - "methods": [ - "commit_schema" - ] - }, - "RollbackSchema": { - "methods": [ - "rollback_schema" - ] - }, - "DeleteSchemaRevision": { - "methods": [ - "delete_schema_revision" - ] - }, - "DeleteSchema": { - "methods": [ - "delete_schema" - ] - }, - "ValidateSchema": { - "methods": [ - "validate_schema" - ] - }, - "ValidateMessage": { - "methods": [ - "validate_message" - ] - } - } - } - } - }, - "Publisher": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::PubSub::V1::Publisher::Client", - "rpcs": { - "CreateTopic": { - "methods": [ - "create_topic" - ] - }, - "UpdateTopic": { - "methods": [ - "update_topic" - ] - }, - "Publish": { - "methods": [ - "publish" - ] - }, - "GetTopic": { - "methods": [ - "get_topic" - ] - }, - "ListTopics": { - "methods": [ - "list_topics" - ] - }, - "ListTopicSubscriptions": { - "methods": [ - "list_topic_subscriptions" - ] - }, - "ListTopicSnapshots": { - "methods": [ - "list_topic_snapshots" - ] - }, - "DeleteTopic": { - "methods": [ - "delete_topic" - ] - }, - "DetachSubscription": { - "methods": [ - "detach_subscription" - ] - } - } - } - } - }, - "Subscriber": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::PubSub::V1::Subscriber::Client", - "rpcs": { - "CreateSubscription": { - "methods": [ - "create_subscription" - ] - }, - "GetSubscription": { - "methods": [ - "get_subscription" - ] - }, - "UpdateSubscription": { - "methods": [ - "update_subscription" - ] - }, - "ListSubscriptions": { - "methods": [ - "list_subscriptions" - ] - }, - "DeleteSubscription": { - "methods": [ - "delete_subscription" - ] - }, - "ModifyAckDeadline": { - "methods": [ - "modify_ack_deadline" - ] - }, - "Acknowledge": { - "methods": [ - "acknowledge" - ] - }, - "Pull": { - "methods": [ - "pull" - ] - }, - "StreamingPull": { - "methods": [ - "streaming_pull" - ] - }, - "ModifyPushConfig": { - "methods": [ - "modify_push_config" - ] - }, - "GetSnapshot": { - "methods": [ - "get_snapshot" - ] - }, - "ListSnapshots": { - "methods": [ - "list_snapshots" - ] - }, - "CreateSnapshot": { - "methods": [ - "create_snapshot" - ] - }, - "UpdateSnapshot": { - "methods": [ - "update_snapshot" - ] - }, - "DeleteSnapshot": { - "methods": [ - "delete_snapshot" - ] - }, - "Seek": { - "methods": [ - "seek" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec b/owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec deleted file mode 100644 index 0ced01f1ba31..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/google-cloud-pubsub-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/pubsub/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-pubsub-v1" - gem.version = Google::Cloud::PubSub::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. Note that google-cloud-pubsub-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-pubsub instead. See the readme for more details." - gem.summary = "Provides reliable, many-to-many, asynchronous messaging between applications." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.7" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-iam-v1", ">= 0.7", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-v1.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-v1.rb deleted file mode 100644 index 0e85d899ff9d..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google-cloud-pubsub-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/pubsub/v1" diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.rb deleted file mode 100644 index f8c68fb0adc4..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1.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! - -require "google/cloud/pubsub/v1/schema_service" -require "google/cloud/pubsub/v1/publisher" -require "google/cloud/pubsub/v1/subscriber" -require "google/cloud/pubsub/v1/version" - -module Google - module Cloud - module PubSub - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/pubsub/v1" - # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/pubsub/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.rb deleted file mode 100644 index 6ce79c89fcb0..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher.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! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/pubsub/v1/version" - -require "google/cloud/pubsub/v1/publisher/credentials" -require "google/cloud/pubsub/v1/publisher/paths" -require "google/cloud/pubsub/v1/publisher/client" - -module Google - module Cloud - module PubSub - module V1 - ## - # The service that an application uses to manipulate topics, and to send - # messages to a topic. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/pubsub/v1/publisher" - # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new - # - module Publisher - end - end - end - end -end - -helper_path = ::File.join __dir__, "publisher", "helpers.rb" -require "google/cloud/pubsub/v1/publisher/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb deleted file mode 100644 index 1fe189d24472..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/client.rb +++ /dev/null @@ -1,1316 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/pubsub/v1/pubsub_pb" -require "google/iam/v1" - -module Google - module Cloud - module PubSub - module V1 - module Publisher - ## - # Client for the Publisher service. - # - # The service that an application uses to manipulate topics, and to send - # messages to a topic. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :publisher_stub - - ## - # Configure the Publisher Client class. - # - # See {::Google::Cloud::PubSub::V1::Publisher::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Publisher clients - # ::Google::Cloud::PubSub::V1::Publisher::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", "PubSub", "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_topic.timeout = 60.0 - default_config.rpcs.create_topic.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_topic.timeout = 60.0 - default_config.rpcs.update_topic.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.publish.timeout = 60.0 - default_config.rpcs.publish.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 4, retry_codes: [10, 1, 13, 8, 2, 14, 4] - } - - default_config.rpcs.get_topic.timeout = 60.0 - default_config.rpcs.get_topic.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.list_topics.timeout = 60.0 - default_config.rpcs.list_topics.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.list_topic_subscriptions.timeout = 60.0 - default_config.rpcs.list_topic_subscriptions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.list_topic_snapshots.timeout = 60.0 - default_config.rpcs.list_topic_snapshots.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.delete_topic.timeout = 60.0 - default_config.rpcs.delete_topic.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.detach_subscription.timeout = 60.0 - default_config.rpcs.detach_subscription.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Publisher 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::PubSub::V1::Publisher::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 - @publisher_stub.universe_domain - end - - ## - # Create a new Publisher client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Publisher 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/pubsub/v1/pubsub_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 - - @publisher_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::PubSub::V1::Publisher::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @publisher_stub.endpoint - config.universe_domain = @publisher_stub.universe_domain - end - end - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates the given topic with the given name. See the [resource name rules] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - # - # @overload create_topic(request, options = nil) - # Pass arguments to `create_topic` via a request object, either of type - # {::Google::Cloud::PubSub::V1::Topic} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::Topic, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_topic(name: nil, labels: nil, message_storage_policy: nil, kms_key_name: nil, schema_settings: nil, satisfies_pzs: nil, message_retention_duration: nil, ingestion_data_source_settings: nil) - # Pass arguments to `create_topic` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the topic. It must have the format - # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - # signs (`%`). It must be between 3 and 255 characters in length, and it - # must not start with `"goog"`. - # @param labels [::Hash{::String => ::String}] - # Optional. See [Creating and managing labels] - # (https://cloud.google.com/pubsub/docs/labels). - # @param message_storage_policy [::Google::Cloud::PubSub::V1::MessageStoragePolicy, ::Hash] - # Optional. Policy constraining the set of Google Cloud Platform regions - # where messages published to the topic may be stored. If not present, then - # no constraints are in effect. - # @param kms_key_name [::String] - # Optional. The resource name of the Cloud KMS CryptoKey to be used to - # protect access to messages published on this topic. - # - # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @param schema_settings [::Google::Cloud::PubSub::V1::SchemaSettings, ::Hash] - # Optional. Settings for validating messages published against a schema. - # @param satisfies_pzs [::Boolean] - # Optional. Reserved for future use. This field is set only in responses from - # the server; it is ignored if it is set in any requests. - # @param message_retention_duration [::Google::Protobuf::Duration, ::Hash] - # Optional. Indicates the minimum duration to retain a message after it is - # published to the topic. If this field is set, messages published to the - # topic in the last `message_retention_duration` are always available to - # subscribers. For instance, it allows any attached subscription to [seek to - # a - # timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - # that is up to `message_retention_duration` in the past. If this field is - # not set, message retention is controlled by settings on individual - # subscriptions. Cannot be more than 31 days or less than 10 minutes. - # @param ingestion_data_source_settings [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings, ::Hash] - # Optional. Settings for ingestion from a data source into this topic. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Topic] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Topic] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::Topic.new - # - # # Call the create_topic method. - # result = client.create_topic request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Topic. - # p result - # - def create_topic request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::Topic - - # Converts hash and nil to 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_topic.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_topic.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_topic.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :create_topic, request, options: options 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 an existing topic by updating the fields specified in the update - # mask. Note that certain properties of a topic are not modifiable. - # - # @overload update_topic(request, options = nil) - # Pass arguments to `update_topic` via a request object, either of type - # {::Google::Cloud::PubSub::V1::UpdateTopicRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::UpdateTopicRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_topic(topic: nil, update_mask: nil) - # Pass arguments to `update_topic` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param topic [::Google::Cloud::PubSub::V1::Topic, ::Hash] - # Required. The updated topic object. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Indicates which fields in the provided topic to update. Must be - # specified and non-empty. Note that if `update_mask` contains - # "message_storage_policy" but the `message_storage_policy` is not set in - # the `topic` provided above, then the updated value is determined by the - # policy configured at the project or organization level. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Topic] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Topic] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::UpdateTopicRequest.new - # - # # Call the update_topic method. - # result = client.update_topic request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Topic. - # p result - # - def update_topic request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::UpdateTopicRequest - - # Converts hash and nil to 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_topic.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.topic&.name - header_params["topic.name"] = request.topic.name - end - - request_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_topic.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_topic.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :update_topic, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - # does not exist. - # - # @overload publish(request, options = nil) - # Pass arguments to `publish` via a request object, either of type - # {::Google::Cloud::PubSub::V1::PublishRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::PublishRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload publish(topic: nil, messages: nil) - # Pass arguments to `publish` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param topic [::String] - # Required. The messages in the request will be published on this topic. - # Format is `projects/{project}/topics/{topic}`. - # @param messages [::Array<::Google::Cloud::PubSub::V1::PubsubMessage, ::Hash>] - # Required. The messages to publish. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::PublishResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::PublishResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::PublishRequest.new - # - # # Call the publish method. - # result = client.publish request - # - # # The returned object is of type Google::Cloud::PubSub::V1::PublishResponse. - # p result - # - def publish request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::PublishRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.publish.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.topic - header_params["topic"] = request.topic - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.publish.timeout, - metadata: metadata, - retry_policy: @config.rpcs.publish.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :publish, request, options: options 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 configuration of a topic. - # - # @overload get_topic(request, options = nil) - # Pass arguments to `get_topic` via a request object, either of type - # {::Google::Cloud::PubSub::V1::GetTopicRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::GetTopicRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_topic(topic: nil) - # Pass arguments to `get_topic` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param topic [::String] - # Required. The name of the topic to get. - # Format is `projects/{project}/topics/{topic}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Topic] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Topic] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::GetTopicRequest.new - # - # # Call the get_topic method. - # result = client.get_topic request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Topic. - # p result - # - def get_topic request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetTopicRequest - - # Converts hash and nil to 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_topic.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.topic - header_params["topic"] = request.topic - end - - request_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_topic.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_topic.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :get_topic, request, options: options 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 matching topics. - # - # @overload list_topics(request, options = nil) - # Pass arguments to `list_topics` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListTopicsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListTopicsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_topics(project: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_topics` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The name of the project in which to list topics. - # Format is `projects/{project-id}`. - # @param page_size [::Integer] - # Optional. Maximum number of topics to return. - # @param page_token [::String] - # Optional. The value returned by the last `ListTopicsResponse`; indicates - # that this is a continuation of a prior `ListTopics` call, and that the - # system should return the next page of data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Topic>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Topic>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListTopicsRequest.new - # - # # Call the list_topics method. - # result = client.list_topics request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PubSub::V1::Topic. - # p item - # end - # - def list_topics request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListTopicsRequest - - # Converts hash and nil to 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_topics.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project - header_params["project"] = request.project - end - - request_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_topics.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_topics.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :list_topics, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @publisher_stub, :list_topics, 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 the names of the attached subscriptions on this topic. - # - # @overload list_topic_subscriptions(request, options = nil) - # Pass arguments to `list_topic_subscriptions` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_topic_subscriptions(topic: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_topic_subscriptions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param topic [::String] - # Required. The name of the topic that subscriptions are attached to. - # Format is `projects/{project}/topics/{topic}`. - # @param page_size [::Integer] - # Optional. Maximum number of subscription names to return. - # @param page_token [::String] - # Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - # indicates that this is a continuation of a prior `ListTopicSubscriptions` - # call, and that the system should return the next page of data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new - # - # # Call the list_topic_subscriptions method. - # result = client.list_topic_subscriptions request - # - # # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse. - # p result - # - def list_topic_subscriptions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest - - # Converts hash and nil to 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_topic_subscriptions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.topic - header_params["topic"] = request.topic - end - - request_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_topic_subscriptions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_topic_subscriptions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :list_topic_subscriptions, request, options: options 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 names of the snapshots on this topic. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # - # @overload list_topic_snapshots(request, options = nil) - # Pass arguments to `list_topic_snapshots` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_topic_snapshots(topic: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_topic_snapshots` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param topic [::String] - # Required. The name of the topic that snapshots are attached to. - # Format is `projects/{project}/topics/{topic}`. - # @param page_size [::Integer] - # Optional. Maximum number of snapshot names to return. - # @param page_token [::String] - # Optional. The value returned by the last `ListTopicSnapshotsResponse`; - # indicates that this is a continuation of a prior `ListTopicSnapshots` call, - # and that the system should return the next page of data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new - # - # # Call the list_topic_snapshots method. - # result = client.list_topic_snapshots request - # - # # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse. - # p result - # - def list_topic_snapshots request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest - - # Converts hash and nil to 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_topic_snapshots.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.topic - header_params["topic"] = request.topic - end - - request_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_topic_snapshots.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_topic_snapshots.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :list_topic_snapshots, request, options: options 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 topic with the given name. Returns `NOT_FOUND` if the topic - # does not exist. After a topic is deleted, a new topic may be created with - # the same name; this is an entirely new topic with none of the old - # configuration or subscriptions. Existing subscriptions to this topic are - # not deleted, but their `topic` field is set to `_deleted-topic_`. - # - # @overload delete_topic(request, options = nil) - # Pass arguments to `delete_topic` via a request object, either of type - # {::Google::Cloud::PubSub::V1::DeleteTopicRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::DeleteTopicRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_topic(topic: nil) - # Pass arguments to `delete_topic` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param topic [::String] - # Required. Name of the topic to delete. - # Format is `projects/{project}/topics/{topic}`. - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::DeleteTopicRequest.new - # - # # Call the delete_topic method. - # result = client.delete_topic request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_topic request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteTopicRequest - - # Converts hash and nil to 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_topic.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.topic - header_params["topic"] = request.topic - end - - request_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_topic.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_topic.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :delete_topic, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Detaches a subscription from this topic. All messages retained in the - # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests - # will return FAILED_PRECONDITION. If the subscription is a push - # subscription, pushes to the endpoint will stop. - # - # @overload detach_subscription(request, options = nil) - # Pass arguments to `detach_subscription` via a request object, either of type - # {::Google::Cloud::PubSub::V1::DetachSubscriptionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload detach_subscription(subscription: nil) - # Pass arguments to `detach_subscription` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The subscription to detach. - # Format is `projects/{project}/subscriptions/{subscription}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::DetachSubscriptionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::DetachSubscriptionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Publisher::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new - # - # # Call the detach_subscription method. - # result = client.detach_subscription request - # - # # The returned object is of type Google::Cloud::PubSub::V1::DetachSubscriptionResponse. - # p result - # - def detach_subscription request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.detach_subscription.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.detach_subscription.timeout, - metadata: metadata, - retry_policy: @config.rpcs.detach_subscription.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @publisher_stub.call_rpc :detach_subscription, request, options: options 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 Publisher API. - # - # This class represents the configuration for Publisher, - # providing control 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::PubSub::V1::Publisher::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_topic to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PubSub::V1::Publisher::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_topic.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_topic.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials 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 = "pubsub.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 Publisher API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_topic` - # @return [::Gapic::Config::Method] - # - attr_reader :create_topic - ## - # RPC-specific configuration for `update_topic` - # @return [::Gapic::Config::Method] - # - attr_reader :update_topic - ## - # RPC-specific configuration for `publish` - # @return [::Gapic::Config::Method] - # - attr_reader :publish - ## - # RPC-specific configuration for `get_topic` - # @return [::Gapic::Config::Method] - # - attr_reader :get_topic - ## - # RPC-specific configuration for `list_topics` - # @return [::Gapic::Config::Method] - # - attr_reader :list_topics - ## - # RPC-specific configuration for `list_topic_subscriptions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_topic_subscriptions - ## - # RPC-specific configuration for `list_topic_snapshots` - # @return [::Gapic::Config::Method] - # - attr_reader :list_topic_snapshots - ## - # RPC-specific configuration for `delete_topic` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_topic - ## - # RPC-specific configuration for `detach_subscription` - # @return [::Gapic::Config::Method] - # - attr_reader :detach_subscription - - # @private - def initialize parent_rpcs = nil - create_topic_config = parent_rpcs.create_topic if parent_rpcs.respond_to? :create_topic - @create_topic = ::Gapic::Config::Method.new create_topic_config - update_topic_config = parent_rpcs.update_topic if parent_rpcs.respond_to? :update_topic - @update_topic = ::Gapic::Config::Method.new update_topic_config - publish_config = parent_rpcs.publish if parent_rpcs.respond_to? :publish - @publish = ::Gapic::Config::Method.new publish_config - get_topic_config = parent_rpcs.get_topic if parent_rpcs.respond_to? :get_topic - @get_topic = ::Gapic::Config::Method.new get_topic_config - list_topics_config = parent_rpcs.list_topics if parent_rpcs.respond_to? :list_topics - @list_topics = ::Gapic::Config::Method.new list_topics_config - list_topic_subscriptions_config = parent_rpcs.list_topic_subscriptions if parent_rpcs.respond_to? :list_topic_subscriptions - @list_topic_subscriptions = ::Gapic::Config::Method.new list_topic_subscriptions_config - list_topic_snapshots_config = parent_rpcs.list_topic_snapshots if parent_rpcs.respond_to? :list_topic_snapshots - @list_topic_snapshots = ::Gapic::Config::Method.new list_topic_snapshots_config - delete_topic_config = parent_rpcs.delete_topic if parent_rpcs.respond_to? :delete_topic - @delete_topic = ::Gapic::Config::Method.new delete_topic_config - detach_subscription_config = parent_rpcs.detach_subscription if parent_rpcs.respond_to? :detach_subscription - @detach_subscription = ::Gapic::Config::Method.new detach_subscription_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/credentials.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/credentials.rb deleted file mode 100644 index 9eb9768e026e..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/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 PubSub - module V1 - module Publisher - # Credentials for the Publisher API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - self.env_vars = [ - "PUBSUB_CREDENTIALS", - "PUBSUB_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PUBSUB_CREDENTIALS_JSON", - "PUBSUB_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-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb deleted file mode 100644 index 0376911efb4d..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/publisher/paths.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PubSub - module V1 - module Publisher - # Path helper methods for the Publisher 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 Schema resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/schemas/{schema}` - # - # @param project [String] - # @param schema [String] - # - # @return [::String] - def schema_path project:, schema: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/schemas/#{schema}" - end - - ## - # Create a fully-qualified Subscription resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/subscriptions/{subscription}` - # - # @param project [String] - # @param subscription [String] - # - # @return [::String] - def subscription_path project:, subscription: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/subscriptions/#{subscription}" - end - - ## - # Create a fully-qualified Topic resource string. - # - # @overload topic_path(project:, topic:) - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @overload topic_path() - # The resource will be in the following format: - # - # `_deleted-topic_` - # - # @return [::String] - def topic_path **args - resources = { - "project:topic" => (proc do |project:, topic:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end), - "" => (proc do - "_deleted-topic_" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.rb deleted file mode 100644 index a21c0de3bf59..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service.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 "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/pubsub/v1/version" - -require "google/cloud/pubsub/v1/schema_service/credentials" -require "google/cloud/pubsub/v1/schema_service/paths" -require "google/cloud/pubsub/v1/schema_service/client" - -module Google - module Cloud - module PubSub - module V1 - ## - # Service for doing schema-related operations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/pubsub/v1/schema_service" - # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new - # - module SchemaService - end - end - end - end -end - -helper_path = ::File.join __dir__, "schema_service", "helpers.rb" -require "google/cloud/pubsub/v1/schema_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb deleted file mode 100644 index 8fe361fa2917..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/client.rb +++ /dev/null @@ -1,1404 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/pubsub/v1/schema_pb" -require "google/iam/v1" - -module Google - module Cloud - module PubSub - module V1 - module SchemaService - ## - # Client for the SchemaService service. - # - # Service for doing schema-related operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :schema_service_stub - - ## - # Configure the SchemaService Client class. - # - # See {::Google::Cloud::PubSub::V1::SchemaService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SchemaService clients - # ::Google::Cloud::PubSub::V1::SchemaService::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", "PubSub", "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_schema.timeout = 60.0 - default_config.rpcs.create_schema.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_schema.timeout = 60.0 - default_config.rpcs.get_schema.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_schemas.timeout = 60.0 - default_config.rpcs.list_schemas.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_schema_revisions.timeout = 60.0 - default_config.rpcs.list_schema_revisions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.commit_schema.timeout = 60.0 - default_config.rpcs.commit_schema.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.rollback_schema.timeout = 60.0 - default_config.rpcs.rollback_schema.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_schema_revision.timeout = 60.0 - default_config.rpcs.delete_schema_revision.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_schema.timeout = 60.0 - default_config.rpcs.delete_schema.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.validate_schema.timeout = 60.0 - default_config.rpcs.validate_schema.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.validate_message.timeout = 60.0 - default_config.rpcs.validate_message.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SchemaService 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::PubSub::V1::SchemaService::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 - @schema_service_stub.universe_domain - end - - ## - # Create a new SchemaService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SchemaService 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/pubsub/v1/schema_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 - - @schema_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::PubSub::V1::SchemaService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @schema_service_stub.endpoint - config.universe_domain = @schema_service_stub.universe_domain - end - end - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a schema. - # - # @overload create_schema(request, options = nil) - # Pass arguments to `create_schema` via a request object, either of type - # {::Google::Cloud::PubSub::V1::CreateSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::CreateSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_schema(parent: nil, schema: nil, schema_id: nil) - # Pass arguments to `create_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 in which to create the schema. - # Format is `projects/{project-id}`. - # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] - # Required. The schema object to create. - # - # This schema's `name` parameter is ignored. The schema object returned - # by CreateSchema will have a `name` made using the given `parent` and - # `schema_id`. - # @param schema_id [::String] - # The ID to use for the schema, which will become the final component of - # the schema's resource name. - # - # See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - # resource name constraints. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::CreateSchemaRequest.new - # - # # Call the create_schema method. - # result = client.create_schema request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Schema. - # p result - # - def create_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::CreateSchemaRequest - - # Converts hash and nil to 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_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :create_schema, request, options: options 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 a schema. - # - # @overload get_schema(request, options = nil) - # Pass arguments to `get_schema` via a request object, either of type - # {::Google::Cloud::PubSub::V1::GetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::GetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_schema(name: nil, view: nil) - # Pass arguments to `get_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the schema to get. - # Format is `projects/{project}/schemas/{schema}`. - # @param view [::Google::Cloud::PubSub::V1::SchemaView] - # The set of fields to return in the response. If not set, returns a Schema - # with all fields filled out. Set to `BASIC` to omit the `definition`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::GetSchemaRequest.new - # - # # Call the get_schema method. - # result = client.get_schema request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Schema. - # p result - # - def get_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetSchemaRequest - - # Converts hash and nil to 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_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :get_schema, request, options: options 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 schemas in a project. - # - # @overload list_schemas(request, options = nil) - # Pass arguments to `list_schemas` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListSchemasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListSchemasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_schemas(parent: nil, view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_schemas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 in which to list schemas. - # Format is `projects/{project-id}`. - # @param view [::Google::Cloud::PubSub::V1::SchemaView] - # The set of Schema fields to return in the response. If not set, returns - # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - # retrieve all fields. - # @param page_size [::Integer] - # Maximum number of schemas to return. - # @param page_token [::String] - # The value returned by the last `ListSchemasResponse`; indicates that - # this is a continuation of a prior `ListSchemas` call, and that the - # system should return the next page of data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Schema>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Schema>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListSchemasRequest.new - # - # # Call the list_schemas method. - # result = client.list_schemas request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PubSub::V1::Schema. - # p item - # end - # - def list_schemas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSchemasRequest - - # Converts hash and nil to 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_schemas.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_schemas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_schemas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :list_schemas, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schemas, 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 schema revisions for the named schema. - # - # @overload list_schema_revisions(request, options = nil) - # Pass arguments to `list_schema_revisions` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_schema_revisions(name: nil, view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_schema_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 schema to list revisions for. - # @param view [::Google::Cloud::PubSub::V1::SchemaView] - # The set of Schema fields to return in the response. If not set, returns - # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - # retrieve all fields. - # @param page_size [::Integer] - # The maximum number of revisions to return per page. - # @param page_token [::String] - # The page token, received from a previous ListSchemaRevisions 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::PubSub::V1::Schema>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Schema>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new - # - # # Call the list_schema_revisions method. - # result = client.list_schema_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::PubSub::V1::Schema. - # p item - # end - # - def list_schema_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest - - # Converts hash and nil to 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_schema_revisions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_schema_revisions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_schema_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :list_schema_revisions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schema_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 - - ## - # Commits a new schema revision to an existing schema. - # - # @overload commit_schema(request, options = nil) - # Pass arguments to `commit_schema` via a request object, either of type - # {::Google::Cloud::PubSub::V1::CommitSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::CommitSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload commit_schema(name: nil, schema: nil) - # Pass arguments to `commit_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the schema we are revising. - # Format is `projects/{project}/schemas/{schema}`. - # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] - # Required. The schema revision to commit. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::CommitSchemaRequest.new - # - # # Call the commit_schema method. - # result = client.commit_schema request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Schema. - # p result - # - def commit_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::CommitSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.commit_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.commit_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.commit_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :commit_schema, request, options: options 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 schema revision that is a copy of the provided revision_id. - # - # @overload rollback_schema(request, options = nil) - # Pass arguments to `rollback_schema` via a request object, either of type - # {::Google::Cloud::PubSub::V1::RollbackSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::RollbackSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_schema(name: nil, revision_id: nil) - # Pass arguments to `rollback_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The schema being rolled back with revision id. - # @param revision_id [::String] - # Required. The revision ID to roll back to. - # It must be a revision of the same schema. - # - # Example: c7cfa2a8 - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::RollbackSchemaRequest.new - # - # # Call the rollback_schema method. - # result = client.rollback_schema request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Schema. - # p result - # - def rollback_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::RollbackSchemaRequest - - # Converts hash and nil to 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_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rollback_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :rollback_schema, request, options: options 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 specific schema revision. - # - # @overload delete_schema_revision(request, options = nil) - # Pass arguments to `delete_schema_revision` via a request object, either of type - # {::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_schema_revision(name: nil, revision_id: nil) - # Pass arguments to `delete_schema_revision` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the schema revision to be deleted, with a revision ID - # explicitly included. - # - # Example: `projects/123/schemas/my-schema@c7cfa2a8` - # @param revision_id [::String] - # Optional. This field is deprecated and should not be used for specifying - # the revision ID. The revision ID should be specified via the `name` - # parameter. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Schema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.new - # - # # Call the delete_schema_revision method. - # result = client.delete_schema_revision request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Schema. - # p result - # - def delete_schema_revision request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest - - # Converts hash and nil to 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_schema_revision.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_schema_revision.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_schema_revision.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :delete_schema_revision, request, options: options 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 schema. - # - # @overload delete_schema(request, options = nil) - # Pass arguments to `delete_schema` via a request object, either of type - # {::Google::Cloud::PubSub::V1::DeleteSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::DeleteSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_schema(name: nil) - # Pass arguments to `delete_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 schema to delete. - # Format is `projects/{project}/schemas/{schema}`. - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::DeleteSchemaRequest.new - # - # # Call the delete_schema method. - # result = client.delete_schema request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSchemaRequest - - # Converts hash and nil to 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_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :delete_schema, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Validates a schema. - # - # @overload validate_schema(request, options = nil) - # Pass arguments to `validate_schema` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ValidateSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ValidateSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload validate_schema(parent: nil, schema: nil) - # Pass arguments to `validate_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 in which to validate schemas. - # Format is `projects/{project-id}`. - # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] - # Required. The schema object to validate. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::ValidateSchemaResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::ValidateSchemaResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ValidateSchemaRequest.new - # - # # Call the validate_schema method. - # result = client.validate_schema request - # - # # The returned object is of type Google::Cloud::PubSub::V1::ValidateSchemaResponse. - # p result - # - def validate_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ValidateSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.validate_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.validate_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.validate_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :validate_schema, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Validates a message against a schema. - # - # @overload validate_message(request, options = nil) - # Pass arguments to `validate_message` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ValidateMessageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ValidateMessageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload validate_message(parent: nil, name: nil, schema: nil, message: nil, encoding: nil) - # Pass arguments to `validate_message` via keyword arguments. Note that at - # least one keyword argument is required. To specify no 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 in which to validate schemas. - # Format is `projects/{project-id}`. - # @param name [::String] - # Name of the schema against which to validate. - # - # Format is `projects/{project}/schemas/{schema}`. - # @param schema [::Google::Cloud::PubSub::V1::Schema, ::Hash] - # Ad-hoc schema against which to validate - # @param message [::String] - # Message to validate against the provided `schema_spec`. - # @param encoding [::Google::Cloud::PubSub::V1::Encoding] - # The encoding expected for messages - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::ValidateMessageResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::ValidateMessageResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ValidateMessageRequest.new - # - # # Call the validate_message method. - # result = client.validate_message request - # - # # The returned object is of type Google::Cloud::PubSub::V1::ValidateMessageResponse. - # p result - # - def validate_message request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ValidateMessageRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.validate_message.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.validate_message.timeout, - metadata: metadata, - retry_policy: @config.rpcs.validate_message.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :validate_message, request, options: options 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 SchemaService API. - # - # This class represents the configuration for SchemaService, - # providing control 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::PubSub::V1::SchemaService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_schema to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PubSub::V1::SchemaService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_schema.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_schema.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials 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 = "pubsub.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 SchemaService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :create_schema - ## - # RPC-specific configuration for `get_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_schema - ## - # RPC-specific configuration for `list_schemas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_schemas - ## - # RPC-specific configuration for `list_schema_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_schema_revisions - ## - # RPC-specific configuration for `commit_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :commit_schema - ## - # RPC-specific configuration for `rollback_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback_schema - ## - # RPC-specific configuration for `delete_schema_revision` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_schema_revision - ## - # RPC-specific configuration for `delete_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_schema - ## - # RPC-specific configuration for `validate_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_schema - ## - # RPC-specific configuration for `validate_message` - # @return [::Gapic::Config::Method] - # - attr_reader :validate_message - - # @private - def initialize parent_rpcs = nil - create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema - @create_schema = ::Gapic::Config::Method.new create_schema_config - get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema - @get_schema = ::Gapic::Config::Method.new get_schema_config - list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas - @list_schemas = ::Gapic::Config::Method.new list_schemas_config - list_schema_revisions_config = parent_rpcs.list_schema_revisions if parent_rpcs.respond_to? :list_schema_revisions - @list_schema_revisions = ::Gapic::Config::Method.new list_schema_revisions_config - commit_schema_config = parent_rpcs.commit_schema if parent_rpcs.respond_to? :commit_schema - @commit_schema = ::Gapic::Config::Method.new commit_schema_config - rollback_schema_config = parent_rpcs.rollback_schema if parent_rpcs.respond_to? :rollback_schema - @rollback_schema = ::Gapic::Config::Method.new rollback_schema_config - delete_schema_revision_config = parent_rpcs.delete_schema_revision if parent_rpcs.respond_to? :delete_schema_revision - @delete_schema_revision = ::Gapic::Config::Method.new delete_schema_revision_config - delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema - @delete_schema = ::Gapic::Config::Method.new delete_schema_config - validate_schema_config = parent_rpcs.validate_schema if parent_rpcs.respond_to? :validate_schema - @validate_schema = ::Gapic::Config::Method.new validate_schema_config - validate_message_config = parent_rpcs.validate_message if parent_rpcs.respond_to? :validate_message - @validate_message = ::Gapic::Config::Method.new validate_message_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/credentials.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/credentials.rb deleted file mode 100644 index 6ea00bec95bf..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_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 PubSub - module V1 - module SchemaService - # Credentials for the SchemaService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - self.env_vars = [ - "PUBSUB_CREDENTIALS", - "PUBSUB_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PUBSUB_CREDENTIALS_JSON", - "PUBSUB_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-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/paths.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_service/paths.rb deleted file mode 100644 index 65108811bbcf..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/schema_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 PubSub - module V1 - module SchemaService - # Path helper methods for the SchemaService 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 Schema resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/schemas/{schema}` - # - # @param project [String] - # @param schema [String] - # - # @return [::String] - def schema_path project:, schema: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/schemas/#{schema}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.rb deleted file mode 100644 index 43d94a42cc70..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber.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 "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/pubsub/v1/version" - -require "google/cloud/pubsub/v1/subscriber/credentials" -require "google/cloud/pubsub/v1/subscriber/paths" -require "google/cloud/pubsub/v1/subscriber/client" - -module Google - module Cloud - module PubSub - module V1 - ## - # The service that an application uses to manipulate subscriptions and to - # consume messages from a subscription via the `Pull` method or by - # establishing a bi-directional stream using the `StreamingPull` method. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/pubsub/v1/subscriber" - # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new - # - module Subscriber - end - end - end - end -end - -helper_path = ::File.join __dir__, "subscriber", "helpers.rb" -require "google/cloud/pubsub/v1/subscriber/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb deleted file mode 100644 index 27b6bf1553bb..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/client.rb +++ /dev/null @@ -1,2206 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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/pubsub/v1/pubsub_pb" -require "google/iam/v1" - -module Google - module Cloud - module PubSub - module V1 - module Subscriber - ## - # Client for the Subscriber service. - # - # The service that an application uses to manipulate subscriptions and to - # consume messages from a subscription via the `Pull` method or by - # establishing a bi-directional stream using the `StreamingPull` method. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "pubsub.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :subscriber_stub - - ## - # Configure the Subscriber Client class. - # - # See {::Google::Cloud::PubSub::V1::Subscriber::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Subscriber clients - # ::Google::Cloud::PubSub::V1::Subscriber::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", "PubSub", "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_subscription.timeout = 60.0 - default_config.rpcs.create_subscription.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.get_subscription.timeout = 60.0 - default_config.rpcs.get_subscription.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.update_subscription.timeout = 60.0 - default_config.rpcs.update_subscription.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_subscriptions.timeout = 60.0 - default_config.rpcs.list_subscriptions.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.delete_subscription.timeout = 60.0 - default_config.rpcs.delete_subscription.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.modify_ack_deadline.timeout = 60.0 - default_config.rpcs.modify_ack_deadline.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.acknowledge.timeout = 60.0 - default_config.rpcs.acknowledge.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.pull.timeout = 60.0 - default_config.rpcs.pull.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14, 13] - } - - default_config.rpcs.streaming_pull.timeout = 900.0 - default_config.rpcs.streaming_pull.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 4, retry_codes: [4, 8, 10, 13, 14] - } - - default_config.rpcs.modify_push_config.timeout = 60.0 - default_config.rpcs.modify_push_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_snapshot.timeout = 60.0 - default_config.rpcs.get_snapshot.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.list_snapshots.timeout = 60.0 - default_config.rpcs.list_snapshots.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config.rpcs.create_snapshot.timeout = 60.0 - default_config.rpcs.create_snapshot.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_snapshot.timeout = 60.0 - default_config.rpcs.update_snapshot.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_snapshot.timeout = 60.0 - default_config.rpcs.delete_snapshot.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.seek.timeout = 60.0 - default_config.rpcs.seek.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 10, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Subscriber 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::PubSub::V1::Subscriber::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 - @subscriber_stub.universe_domain - end - - ## - # Create a new Subscriber client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Subscriber 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/pubsub/v1/pubsub_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 - - @subscriber_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::PubSub::V1::Subscriber::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @subscriber_stub.endpoint - config.universe_domain = @subscriber_stub.universe_domain - end - end - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a subscription to a given topic. See the [resource name rules] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - # If the subscription already exists, returns `ALREADY_EXISTS`. - # If the corresponding topic doesn't exist, returns `NOT_FOUND`. - # - # If the name is not provided in the request, the server will assign a random - # name for this subscription on the same project as the topic, conforming - # to the [resource name format] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - # generated name is populated in the returned Subscription object. Note that - # for REST API requests, you must specify a name in the request. - # - # @overload create_subscription(request, options = nil) - # Pass arguments to `create_subscription` via a request object, either of type - # {::Google::Cloud::PubSub::V1::Subscription} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::Subscription, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subscription(name: nil, topic: nil, push_config: nil, bigquery_config: nil, cloud_storage_config: nil, ack_deadline_seconds: nil, retain_acked_messages: nil, message_retention_duration: nil, labels: nil, enable_message_ordering: nil, expiration_policy: nil, filter: nil, dead_letter_policy: nil, retry_policy: nil, detached: nil, enable_exactly_once_delivery: nil) - # Pass arguments to `create_subscription` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the subscription. It must have the format - # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - # start with a letter, and contain only letters (`[A-Za-z]`), numbers - # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - # in length, and it must not start with `"goog"`. - # @param topic [::String] - # Required. The name of the topic from which this subscription is receiving - # messages. Format is `projects/{project}/topics/{topic}`. The value of this - # field will be `_deleted-topic_` if the topic has been deleted. - # @param push_config [::Google::Cloud::PubSub::V1::PushConfig, ::Hash] - # Optional. If push delivery is used with this subscription, this field is - # used to configure it. - # @param bigquery_config [::Google::Cloud::PubSub::V1::BigQueryConfig, ::Hash] - # Optional. If delivery to BigQuery is used with this subscription, this - # field is used to configure it. - # @param cloud_storage_config [::Google::Cloud::PubSub::V1::CloudStorageConfig, ::Hash] - # Optional. If delivery to Google Cloud Storage is used with this - # subscription, this field is used to configure it. - # @param ack_deadline_seconds [::Integer] - # Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - # waits for the subscriber to acknowledge receipt before resending the - # message. In the interval after the message is delivered and before it is - # acknowledged, it is considered to be _outstanding_. During that time - # period, the message will not be redelivered (on a best-effort basis). - # - # For pull subscriptions, this value is used as the initial value for the ack - # deadline. To override this value for a given message, call - # `ModifyAckDeadline` with the corresponding `ack_id` if using - # non-streaming pull or send the `ack_id` in a - # `StreamingModifyAckDeadlineRequest` if using streaming pull. - # The minimum custom deadline you can specify is 10 seconds. - # The maximum custom deadline you can specify is 600 seconds (10 minutes). - # If this parameter is 0, a default value of 10 seconds is used. - # - # For push delivery, this value is also used to set the request timeout for - # the call to the push endpoint. - # - # If the subscriber never acknowledges the message, the Pub/Sub - # system will eventually redeliver the message. - # @param retain_acked_messages [::Boolean] - # Optional. Indicates whether to retain acknowledged messages. If true, then - # messages are not expunged from the subscription's backlog, even if they are - # acknowledged, until they fall out of the `message_retention_duration` - # window. This must be true if you would like to [`Seek` to a timestamp] - # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - # the past to replay previously-acknowledged messages. - # @param message_retention_duration [::Google::Protobuf::Duration, ::Hash] - # Optional. How long to retain unacknowledged messages in the subscription's - # backlog, from the moment a message is published. If `retain_acked_messages` - # is true, then this also configures the retention of acknowledged messages, - # and thus configures how far back in time a `Seek` can be done. Defaults to - # 7 days. Cannot be more than 31 days or less than 10 minutes. - # @param labels [::Hash{::String => ::String}] - # Optional. See [Creating and managing - # labels](https://cloud.google.com/pubsub/docs/labels). - # @param enable_message_ordering [::Boolean] - # Optional. If true, messages published with the same `ordering_key` in - # `PubsubMessage` will be delivered to the subscribers in the order in which - # they are received by the Pub/Sub system. Otherwise, they may be delivered - # in any order. - # @param expiration_policy [::Google::Cloud::PubSub::V1::ExpirationPolicy, ::Hash] - # Optional. A policy that specifies the conditions for this subscription's - # expiration. A subscription is considered active as long as any connected - # subscriber is successfully consuming messages from the subscription or is - # issuing operations on the subscription. If `expiration_policy` is not set, - # a *default policy* with `ttl` of 31 days will be used. The minimum allowed - # value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - # but `expiration_policy.ttl` is not set, the subscription never expires. - # @param filter [::String] - # Optional. An expression written in the Pub/Sub [filter - # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - # then only `PubsubMessage`s whose `attributes` field matches the filter are - # delivered on this subscription. If empty, then no messages are filtered - # out. - # @param dead_letter_policy [::Google::Cloud::PubSub::V1::DeadLetterPolicy, ::Hash] - # Optional. A policy that specifies the conditions for dead lettering - # messages in this subscription. If dead_letter_policy is not set, dead - # lettering is disabled. - # - # The Pub/Sub service account associated with this subscriptions's - # parent project (i.e., - # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - # permission to Acknowledge() messages on this subscription. - # @param retry_policy [::Google::Cloud::PubSub::V1::RetryPolicy, ::Hash] - # Optional. A policy that specifies how Pub/Sub retries message delivery for - # this subscription. - # - # If not set, the default retry policy is applied. This generally implies - # that messages will be retried as soon as possible for healthy subscribers. - # RetryPolicy will be triggered on NACKs or acknowledgement deadline - # exceeded events for a given message. - # @param detached [::Boolean] - # Optional. Indicates whether the subscription is detached from its topic. - # Detached subscriptions don't receive messages from their topic and don't - # retain any backlog. `Pull` and `StreamingPull` requests will return - # FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - # the endpoint will not be made. - # @param enable_exactly_once_delivery [::Boolean] - # Optional. If true, Pub/Sub provides the following guarantees for the - # delivery of a message with a given value of `message_id` on this - # subscription: - # - # * The message sent to a subscriber is guaranteed not to be resent - # before the message's acknowledgement deadline expires. - # * An acknowledged message will not be resent to a subscriber. - # - # Note that subscribers may still receive multiple copies of a message - # when `enable_exactly_once_delivery` is true if the message was published - # multiple times by a publisher client. These copies are considered distinct - # by Pub/Sub and have distinct `message_id` values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Subscription] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Subscription] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::Subscription.new - # - # # Call the create_subscription method. - # result = client.create_subscription request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Subscription. - # p result - # - def create_subscription request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::Subscription - - # Converts hash and nil to 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_subscription.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_subscription.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_subscription.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :create_subscription, request, options: options 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 configuration details of a subscription. - # - # @overload get_subscription(request, options = nil) - # Pass arguments to `get_subscription` via a request object, either of type - # {::Google::Cloud::PubSub::V1::GetSubscriptionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::GetSubscriptionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_subscription(subscription: nil) - # Pass arguments to `get_subscription` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The name of the subscription to get. - # Format is `projects/{project}/subscriptions/{sub}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Subscription] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Subscription] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new - # - # # Call the get_subscription method. - # result = client.get_subscription request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Subscription. - # p result - # - def get_subscription request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetSubscriptionRequest - - # Converts hash and nil to 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_subscription.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_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_subscription.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_subscription.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :get_subscription, request, options: options 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 an existing subscription by updating the fields specified in the - # update mask. Note that certain properties of a subscription, such as its - # topic, are not modifiable. - # - # @overload update_subscription(request, options = nil) - # Pass arguments to `update_subscription` via a request object, either of type - # {::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subscription(subscription: nil, update_mask: nil) - # Pass arguments to `update_subscription` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::Google::Cloud::PubSub::V1::Subscription, ::Hash] - # Required. The updated subscription object. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Indicates which fields in the provided subscription to update. - # Must be specified and non-empty. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Subscription] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Subscription] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new - # - # # Call the update_subscription method. - # result = client.update_subscription request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Subscription. - # p result - # - def update_subscription request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest - - # Converts hash and nil to 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_subscription.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription&.name - header_params["subscription.name"] = request.subscription.name - end - - request_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_subscription.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_subscription.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :update_subscription, request, options: options 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 matching subscriptions. - # - # @overload list_subscriptions(request, options = nil) - # Pass arguments to `list_subscriptions` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListSubscriptionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_subscriptions(project: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_subscriptions` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The name of the project in which to list subscriptions. - # Format is `projects/{project-id}`. - # @param page_size [::Integer] - # Optional. Maximum number of subscriptions to return. - # @param page_token [::String] - # Optional. The value returned by the last `ListSubscriptionsResponse`; - # indicates that this is a continuation of a prior `ListSubscriptions` call, - # and that the system should return the next page of data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Subscription>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new - # - # # Call the list_subscriptions method. - # result = client.list_subscriptions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PubSub::V1::Subscription. - # p item - # end - # - def list_subscriptions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest - - # Converts hash and nil to 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_subscriptions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project - header_params["project"] = request.project - end - - request_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_subscriptions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_subscriptions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :list_subscriptions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @subscriber_stub, :list_subscriptions, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an existing subscription. All messages retained in the subscription - # are immediately dropped. Calls to `Pull` after deletion will return - # `NOT_FOUND`. After a subscription is deleted, a new one may be created with - # the same name, but the new one has no association with the old - # subscription or its topic unless the same topic is specified. - # - # @overload delete_subscription(request, options = nil) - # Pass arguments to `delete_subscription` via a request object, either of type - # {::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_subscription(subscription: nil) - # Pass arguments to `delete_subscription` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The subscription to delete. - # Format is `projects/{project}/subscriptions/{sub}`. - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new - # - # # Call the delete_subscription method. - # result = client.delete_subscription request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_subscription request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest - - # Converts hash and nil to 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_subscription.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_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_subscription.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_subscription.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :delete_subscription, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Modifies the ack deadline for a specific message. This method is useful - # to indicate that more time is needed to process a message by the - # subscriber, or to make the message available for redelivery if the - # processing was interrupted. Note that this does not modify the - # subscription-level `ackDeadlineSeconds` used for subsequent messages. - # - # @overload modify_ack_deadline(request, options = nil) - # Pass arguments to `modify_ack_deadline` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload modify_ack_deadline(subscription: nil, ack_ids: nil, ack_deadline_seconds: nil) - # Pass arguments to `modify_ack_deadline` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The name of the subscription. - # Format is `projects/{project}/subscriptions/{sub}`. - # @param ack_ids [::Array<::String>] - # Required. List of acknowledgment IDs. - # @param ack_deadline_seconds [::Integer] - # Required. The new ack deadline with respect to the time this request was - # sent to the Pub/Sub system. For example, if the value is 10, the new ack - # deadline will expire 10 seconds after the `ModifyAckDeadline` call was - # made. Specifying zero might immediately make the message available for - # delivery to another subscriber client. This typically results in an - # increase in the rate of message redeliveries (that is, duplicates). - # The minimum deadline you can specify is 0 seconds. - # The maximum deadline you can specify in a single request is 600 seconds - # (10 minutes). - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new - # - # # Call the modify_ack_deadline method. - # result = client.modify_ack_deadline request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def modify_ack_deadline request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.modify_ack_deadline.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.modify_ack_deadline.timeout, - metadata: metadata, - retry_policy: @config.rpcs.modify_ack_deadline.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :modify_ack_deadline, request, options: options 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 the messages associated with the `ack_ids` in the - # `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - # from the subscription. - # - # Acknowledging a message whose ack deadline has expired may succeed, - # but such a message may be redelivered later. Acknowledging a message more - # than once will not result in an error. - # - # @overload acknowledge(request, options = nil) - # Pass arguments to `acknowledge` via a request object, either of type - # {::Google::Cloud::PubSub::V1::AcknowledgeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::AcknowledgeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(subscription: nil, ack_ids: nil) - # Pass arguments to `acknowledge` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The subscription whose message is being acknowledged. - # Format is `projects/{project}/subscriptions/{sub}`. - # @param ack_ids [::Array<::String>] - # Required. The acknowledgment ID for the messages being acknowledged that - # was returned by the Pub/Sub system in the `Pull` response. Must not be - # empty. - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new - # - # # Call the acknowledge method. - # result = client.acknowledge request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def acknowledge request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::AcknowledgeRequest - - # Converts hash and nil to 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.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_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.timeout, - metadata: metadata, - retry_policy: @config.rpcs.acknowledge.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :acknowledge, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pulls messages from the server. - # - # @overload pull(request, options = nil) - # Pass arguments to `pull` via a request object, either of type - # {::Google::Cloud::PubSub::V1::PullRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::PullRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pull(subscription: nil, return_immediately: nil, max_messages: nil) - # Pass arguments to `pull` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The subscription from which messages should be pulled. - # Format is `projects/{project}/subscriptions/{sub}`. - # @param return_immediately [::Boolean] - # Optional. If this field set to true, the system will respond immediately - # even if it there are no messages available to return in the `Pull` - # response. Otherwise, the system may wait (for a bounded amount of time) - # until at least one message is available, rather than returning no messages. - # Warning: setting this field to `true` is discouraged because it adversely - # impacts the performance of `Pull` operations. We recommend that users do - # not set this field. - # @param max_messages [::Integer] - # Required. The maximum number of messages to return for this request. Must - # be a positive integer. The Pub/Sub system may return fewer than the number - # specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::PullResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::PullResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::PullRequest.new - # - # # Call the pull method. - # result = client.pull request - # - # # The returned object is of type Google::Cloud::PubSub::V1::PullResponse. - # p result - # - def pull request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::PullRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.pull.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.pull.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pull.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :pull, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Establishes a stream with the server, which sends messages down to the - # client. The client streams acknowledgements and ack deadline modifications - # back to the server. The server will close the stream and return the status - # on any error. The server may close the stream with status `UNAVAILABLE` to - # reassign server-side resources, in which case, the client should - # re-establish the stream. Flow control can be achieved by configuring the - # underlying RPC channel. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullRequest, ::Hash>] - # An enumerable of {::Google::Cloud::PubSub::V1::StreamingPullRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::PubSub::V1::StreamingPullResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_pull method to start streaming. - # output = client.streaming_pull input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::PubSub::V1::StreamingPullRequest.new - # input << Google::Cloud::PubSub::V1::StreamingPullRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::PubSub::V1::StreamingPullResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_pull request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::PubSub::V1::StreamingPullRequest - end - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.streaming_pull.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.streaming_pull.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_pull.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :streaming_pull, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Modifies the `PushConfig` for a specified subscription. - # - # This may be used to change a push subscription to a pull one (signified by - # an empty `PushConfig`) or vice versa, or change the endpoint URL and other - # attributes of a push subscription. Messages will accumulate for delivery - # continuously through the call regardless of changes to the `PushConfig`. - # - # @overload modify_push_config(request, options = nil) - # Pass arguments to `modify_push_config` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ModifyPushConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload modify_push_config(subscription: nil, push_config: nil) - # Pass arguments to `modify_push_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The name of the subscription. - # Format is `projects/{project}/subscriptions/{sub}`. - # @param push_config [::Google::Cloud::PubSub::V1::PushConfig, ::Hash] - # Required. The push configuration for future deliveries. - # - # An empty `pushConfig` indicates that the Pub/Sub system should - # stop pushing messages from the given subscription and allow - # messages to be pulled and acknowledged - effectively pausing - # the subscription if `Pull` or `StreamingPull` is not called. - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new - # - # # Call the modify_push_config method. - # result = client.modify_push_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def modify_push_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.modify_push_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.modify_push_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.modify_push_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :modify_push_config, request, options: options 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 configuration details of a snapshot. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # - # @overload get_snapshot(request, options = nil) - # Pass arguments to `get_snapshot` via a request object, either of type - # {::Google::Cloud::PubSub::V1::GetSnapshotRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::GetSnapshotRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_snapshot(snapshot: nil) - # Pass arguments to `get_snapshot` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param snapshot [::String] - # Required. The name of the snapshot to get. - # Format is `projects/{project}/snapshots/{snap}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Snapshot] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Snapshot] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new - # - # # Call the get_snapshot method. - # result = client.get_snapshot request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. - # p result - # - def get_snapshot request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::GetSnapshotRequest - - # Converts hash and nil to 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_snapshot.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.snapshot - header_params["snapshot"] = request.snapshot - end - - request_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_snapshot.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_snapshot.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :get_snapshot, request, options: options 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 existing snapshots. Snapshots are used in [Seek]( - # https://cloud.google.com/pubsub/docs/replay-overview) operations, which - # allow you to manage message acknowledgments in bulk. That is, you can set - # the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # - # @overload list_snapshots(request, options = nil) - # Pass arguments to `list_snapshots` via a request object, either of type - # {::Google::Cloud::PubSub::V1::ListSnapshotsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::ListSnapshotsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_snapshots(project: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_snapshots` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The name of the project in which to list snapshots. - # Format is `projects/{project-id}`. - # @param page_size [::Integer] - # Optional. Maximum number of snapshots to return. - # @param page_token [::String] - # Optional. The value returned by the last `ListSnapshotsResponse`; indicates - # that this is a continuation of a prior `ListSnapshots` call, and that the - # system should return the next page of data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::PubSub::V1::Snapshot>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new - # - # # Call the list_snapshots method. - # result = client.list_snapshots request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot. - # p item - # end - # - def list_snapshots request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::ListSnapshotsRequest - - # Converts hash and nil to 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_snapshots.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project - header_params["project"] = request.project - end - - request_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_snapshots.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_snapshots.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :list_snapshots, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @subscriber_stub, :list_snapshots, 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 - - ## - # Creates a snapshot from the requested subscription. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # If the snapshot already exists, returns `ALREADY_EXISTS`. - # If the requested subscription doesn't exist, returns `NOT_FOUND`. - # If the backlog in the subscription is too old -- and the resulting snapshot - # would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - # See also the `Snapshot.expire_time` field. If the name is not provided in - # the request, the server will assign a random - # name for this snapshot on the same project as the subscription, conforming - # to the [resource name format] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - # generated name is populated in the returned Snapshot object. Note that for - # REST API requests, you must specify a name in the request. - # - # @overload create_snapshot(request, options = nil) - # Pass arguments to `create_snapshot` via a request object, either of type - # {::Google::Cloud::PubSub::V1::CreateSnapshotRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::CreateSnapshotRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_snapshot(name: nil, subscription: nil, labels: nil) - # Pass arguments to `create_snapshot` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. User-provided name for this snapshot. If the name is not provided - # in the request, the server will assign a random name for this snapshot on - # the same project as the subscription. Note that for REST API requests, you - # must specify a name. See the [resource name - # rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - # Format is `projects/{project}/snapshots/{snap}`. - # @param subscription [::String] - # Required. The subscription whose backlog the snapshot retains. - # Specifically, the created snapshot is guaranteed to retain: - # (a) The existing backlog on the subscription. More precisely, this is - # defined as the messages in the subscription's backlog that are - # unacknowledged upon the successful completion of the - # `CreateSnapshot` request; as well as: - # (b) Any messages published to the subscription's topic following the - # successful completion of the CreateSnapshot request. - # Format is `projects/{project}/subscriptions/{sub}`. - # @param labels [::Hash{::String => ::String}] - # Optional. See [Creating and managing - # labels](https://cloud.google.com/pubsub/docs/labels). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Snapshot] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Snapshot] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new - # - # # Call the create_snapshot method. - # result = client.create_snapshot request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. - # p result - # - def create_snapshot request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::CreateSnapshotRequest - - # Converts hash and nil to 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_snapshot.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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_snapshot.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_snapshot.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :create_snapshot, request, options: options 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 an existing snapshot by updating the fields specified in the update - # mask. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # - # @overload update_snapshot(request, options = nil) - # Pass arguments to `update_snapshot` via a request object, either of type - # {::Google::Cloud::PubSub::V1::UpdateSnapshotRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_snapshot(snapshot: nil, update_mask: nil) - # Pass arguments to `update_snapshot` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param snapshot [::Google::Cloud::PubSub::V1::Snapshot, ::Hash] - # Required. The updated snapshot object. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Indicates which fields in the provided snapshot to update. - # Must be specified and non-empty. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::Snapshot] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::Snapshot] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new - # - # # Call the update_snapshot method. - # result = client.update_snapshot request - # - # # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. - # p result - # - def update_snapshot request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest - - # Converts hash and nil to 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_snapshot.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.snapshot&.name - header_params["snapshot.name"] = request.snapshot.name - end - - request_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_snapshot.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_snapshot.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :update_snapshot, request, options: options 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 an existing snapshot. Snapshots are used in [Seek] - # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - # allow you to manage message acknowledgments in bulk. That is, you can set - # the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # When the snapshot is deleted, all messages retained in the snapshot - # are immediately dropped. After a snapshot is deleted, a new one may be - # created with the same name, but the new one has no association with the old - # snapshot or its subscription, unless the same subscription is specified. - # - # @overload delete_snapshot(request, options = nil) - # Pass arguments to `delete_snapshot` via a request object, either of type - # {::Google::Cloud::PubSub::V1::DeleteSnapshotRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_snapshot(snapshot: nil) - # Pass arguments to `delete_snapshot` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param snapshot [::String] - # Required. The name of the snapshot to delete. - # Format is `projects/{project}/snapshots/{snap}`. - # - # @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/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new - # - # # Call the delete_snapshot method. - # result = client.delete_snapshot request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_snapshot request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest - - # Converts hash and nil to 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_snapshot.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.snapshot - header_params["snapshot"] = request.snapshot - end - - request_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_snapshot.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_snapshot.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :delete_snapshot, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Seeks an existing subscription to a point in time or to a given snapshot, - # whichever is provided in the request. Snapshots are used in [Seek] - # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - # allow you to manage message acknowledgments in bulk. That is, you can set - # the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. Note that both the subscription and the - # snapshot must be on the same topic. - # - # @overload seek(request, options = nil) - # Pass arguments to `seek` via a request object, either of type - # {::Google::Cloud::PubSub::V1::SeekRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::PubSub::V1::SeekRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload seek(subscription: nil, time: nil, snapshot: nil) - # Pass arguments to `seek` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param subscription [::String] - # Required. The subscription to affect. - # @param time [::Google::Protobuf::Timestamp, ::Hash] - # Optional. The time to seek to. - # Messages retained in the subscription that were published before this - # time are marked as acknowledged, and messages retained in the - # subscription that were published after this time are marked as - # unacknowledged. Note that this operation affects only those messages - # retained in the subscription (configured by the combination of - # `message_retention_duration` and `retain_acked_messages`). For example, - # if `time` corresponds to a point before the message retention - # window (or to a point before the system's notion of the subscription - # creation time), only retained messages will be marked as unacknowledged, - # and already-expunged messages will not be restored. - # @param snapshot [::String] - # Optional. The snapshot to seek to. The snapshot's topic must be the same - # as that of the provided subscription. Format is - # `projects/{project}/snapshots/{snap}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::PubSub::V1::SeekResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::PubSub::V1::SeekResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/pubsub/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::PubSub::V1::Subscriber::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::PubSub::V1::SeekRequest.new - # - # # Call the seek method. - # result = client.seek request - # - # # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse. - # p result - # - def seek request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::PubSub::V1::SeekRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.seek.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::PubSub::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.subscription - header_params["subscription"] = request.subscription - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.seek.timeout, - metadata: metadata, - retry_policy: @config.rpcs.seek.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @subscriber_stub.call_rpc :seek, request, options: options 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 Subscriber API. - # - # This class represents the configuration for Subscriber, - # providing control 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::PubSub::V1::Subscriber::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # 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_subscription to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::PubSub::V1::Subscriber::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_subscription.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_subscription.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials 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 = "pubsub.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 Subscriber API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of 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_subscription` - # @return [::Gapic::Config::Method] - # - attr_reader :create_subscription - ## - # RPC-specific configuration for `get_subscription` - # @return [::Gapic::Config::Method] - # - attr_reader :get_subscription - ## - # RPC-specific configuration for `update_subscription` - # @return [::Gapic::Config::Method] - # - attr_reader :update_subscription - ## - # RPC-specific configuration for `list_subscriptions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_subscriptions - ## - # RPC-specific configuration for `delete_subscription` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_subscription - ## - # RPC-specific configuration for `modify_ack_deadline` - # @return [::Gapic::Config::Method] - # - attr_reader :modify_ack_deadline - ## - # RPC-specific configuration for `acknowledge` - # @return [::Gapic::Config::Method] - # - attr_reader :acknowledge - ## - # RPC-specific configuration for `pull` - # @return [::Gapic::Config::Method] - # - attr_reader :pull - ## - # RPC-specific configuration for `streaming_pull` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_pull - ## - # RPC-specific configuration for `modify_push_config` - # @return [::Gapic::Config::Method] - # - attr_reader :modify_push_config - ## - # RPC-specific configuration for `get_snapshot` - # @return [::Gapic::Config::Method] - # - attr_reader :get_snapshot - ## - # RPC-specific configuration for `list_snapshots` - # @return [::Gapic::Config::Method] - # - attr_reader :list_snapshots - ## - # RPC-specific configuration for `create_snapshot` - # @return [::Gapic::Config::Method] - # - attr_reader :create_snapshot - ## - # RPC-specific configuration for `update_snapshot` - # @return [::Gapic::Config::Method] - # - attr_reader :update_snapshot - ## - # RPC-specific configuration for `delete_snapshot` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_snapshot - ## - # RPC-specific configuration for `seek` - # @return [::Gapic::Config::Method] - # - attr_reader :seek - - # @private - def initialize parent_rpcs = nil - create_subscription_config = parent_rpcs.create_subscription if parent_rpcs.respond_to? :create_subscription - @create_subscription = ::Gapic::Config::Method.new create_subscription_config - get_subscription_config = parent_rpcs.get_subscription if parent_rpcs.respond_to? :get_subscription - @get_subscription = ::Gapic::Config::Method.new get_subscription_config - update_subscription_config = parent_rpcs.update_subscription if parent_rpcs.respond_to? :update_subscription - @update_subscription = ::Gapic::Config::Method.new update_subscription_config - list_subscriptions_config = parent_rpcs.list_subscriptions if parent_rpcs.respond_to? :list_subscriptions - @list_subscriptions = ::Gapic::Config::Method.new list_subscriptions_config - delete_subscription_config = parent_rpcs.delete_subscription if parent_rpcs.respond_to? :delete_subscription - @delete_subscription = ::Gapic::Config::Method.new delete_subscription_config - modify_ack_deadline_config = parent_rpcs.modify_ack_deadline if parent_rpcs.respond_to? :modify_ack_deadline - @modify_ack_deadline = ::Gapic::Config::Method.new modify_ack_deadline_config - acknowledge_config = parent_rpcs.acknowledge if parent_rpcs.respond_to? :acknowledge - @acknowledge = ::Gapic::Config::Method.new acknowledge_config - pull_config = parent_rpcs.pull if parent_rpcs.respond_to? :pull - @pull = ::Gapic::Config::Method.new pull_config - streaming_pull_config = parent_rpcs.streaming_pull if parent_rpcs.respond_to? :streaming_pull - @streaming_pull = ::Gapic::Config::Method.new streaming_pull_config - modify_push_config_config = parent_rpcs.modify_push_config if parent_rpcs.respond_to? :modify_push_config - @modify_push_config = ::Gapic::Config::Method.new modify_push_config_config - get_snapshot_config = parent_rpcs.get_snapshot if parent_rpcs.respond_to? :get_snapshot - @get_snapshot = ::Gapic::Config::Method.new get_snapshot_config - list_snapshots_config = parent_rpcs.list_snapshots if parent_rpcs.respond_to? :list_snapshots - @list_snapshots = ::Gapic::Config::Method.new list_snapshots_config - create_snapshot_config = parent_rpcs.create_snapshot if parent_rpcs.respond_to? :create_snapshot - @create_snapshot = ::Gapic::Config::Method.new create_snapshot_config - update_snapshot_config = parent_rpcs.update_snapshot if parent_rpcs.respond_to? :update_snapshot - @update_snapshot = ::Gapic::Config::Method.new update_snapshot_config - delete_snapshot_config = parent_rpcs.delete_snapshot if parent_rpcs.respond_to? :delete_snapshot - @delete_snapshot = ::Gapic::Config::Method.new delete_snapshot_config - seek_config = parent_rpcs.seek if parent_rpcs.respond_to? :seek - @seek = ::Gapic::Config::Method.new seek_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/credentials.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/credentials.rb deleted file mode 100644 index 2243e2dc1c53..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/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 PubSub - module V1 - module Subscriber - # Credentials for the Subscriber API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub" - ] - self.env_vars = [ - "PUBSUB_CREDENTIALS", - "PUBSUB_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "PUBSUB_CREDENTIALS_JSON", - "PUBSUB_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-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb deleted file mode 100644 index 34479511576c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/subscriber/paths.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PubSub - module V1 - module Subscriber - # Path helper methods for the Subscriber 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 Snapshot resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/snapshots/{snapshot}` - # - # @param project [String] - # @param snapshot [String] - # - # @return [::String] - def snapshot_path project:, snapshot: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/snapshots/#{snapshot}" - end - - ## - # Create a fully-qualified Subscription resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/subscriptions/{subscription}` - # - # @param project [String] - # @param subscription [String] - # - # @return [::String] - def subscription_path project:, subscription: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/subscriptions/#{subscription}" - end - - ## - # Create a fully-qualified Topic resource string. - # - # @overload topic_path(project:, topic:) - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @overload topic_path() - # The resource will be in the following format: - # - # `_deleted-topic_` - # - # @return [::String] - def topic_path **args - resources = { - "project:topic" => (proc do |project:, topic:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end), - "" => (proc do - "_deleted-topic_" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/version.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/v1/version.rb deleted file mode 100644 index c5bc2736b5e9..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/cloud/pubsub/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 PubSub - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb deleted file mode 100644 index d3770e72d070..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_pb.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/pubsub/v1/pubsub.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/pubsub/v1/schema_pb' - - -descriptor_data = "\n\x1dgoogle/pubsub/v1/pubsub.proto\x12\x10google.pubsub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1dgoogle/pubsub/v1/schema.proto\"a\n\x14MessageStoragePolicy\x12(\n\x1b\x61llowed_persistence_regions\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x65nforce_in_transit\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xb8\x01\n\x0eSchemaSettings\x12\x34\n\x06schema\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12\x31\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32\x1a.google.pubsub.v1.EncodingB\x03\xe0\x41\x01\x12\x1e\n\x11\x66irst_revision_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10last_revision_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xea\x03\n\x1bIngestionDataSourceSettings\x12T\n\x0b\x61ws_kinesis\x18\x01 \x01(\x0b\x32\x38.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesisB\x03\xe0\x41\x01H\x00\x1a\xea\x02\n\nAwsKinesis\x12R\n\x05state\x18\x01 \x01(\x0e\x32>.google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.StateB\x03\xe0\x41\x03\x12\x17\n\nstream_arn\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63onsumer_arn\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x61ws_role_arn\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13gcp_service_account\x18\x05 \x01(\tB\x03\xe0\x41\x02\"\x96\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x1d\n\x19KINESIS_PERMISSION_DENIED\x10\x02\x12\x1d\n\x19PUBLISH_PERMISSION_DENIED\x10\x03\x12\x14\n\x10STREAM_NOT_FOUND\x10\x04\x12\x16\n\x12\x43ONSUMER_NOT_FOUND\x10\x05\x42\x08\n\x06source\"\xba\x05\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x06labels\x18\x02 \x03(\x0b\x32#.google.pubsub.v1.Topic.LabelsEntryB\x03\xe0\x41\x01\x12K\n\x16message_storage_policy\x18\x03 \x01(\x0b\x32&.google.pubsub.v1.MessageStoragePolicyB\x03\xe0\x41\x01\x12\x19\n\x0ckms_key_name\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12>\n\x0fschema_settings\x18\x06 \x01(\x0b\x32 .google.pubsub.v1.SchemaSettingsB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x1amessage_retention_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x31\n\x05state\x18\t \x01(\x0e\x32\x1d.google.pubsub.v1.Topic.StateB\x03\xe0\x41\x03\x12Z\n\x1eingestion_data_source_settings\x18\n \x01(\x0b\x32-.google.pubsub.v1.IngestionDataSourceSettingsB\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\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x1c\n\x18INGESTION_RESOURCE_ERROR\x10\x02:T\xea\x41Q\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\x12\x0f_deleted-topic_\"\x80\x02\n\rPubsubMessage\x12\x11\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x01\x12H\n\nattributes\x18\x02 \x03(\x0b\x32/.google.pubsub.v1.PubsubMessage.AttributesEntryB\x03\xe0\x41\x01\x12\x12\n\nmessage_id\x18\x03 \x01(\t\x12\x30\n\x0cpublish_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x0cordering_key\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x0fGetTopicRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\"w\n\x12UpdateTopicRequest\x12+\n\x05topic\x18\x01 \x01(\x0b\x32\x17.google.pubsub.v1.TopicB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"|\n\x0ePublishRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x36\n\x08messages\x18\x02 \x03(\x0b\x32\x1f.google.pubsub.v1.PubsubMessageB\x03\xe0\x41\x02\"+\n\x0fPublishResponse\x12\x18\n\x0bmessage_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\"\x8a\x01\n\x11ListTopicsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\x12ListTopicsResponse\x12,\n\x06topics\x18\x01 \x03(\x0b\x32\x17.google.pubsub.v1.TopicB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x84\x01\n\x1dListTopicSubscriptionsRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x1eListTopicSubscriptionsResponse\x12\x41\n\rsubscriptions\x18\x01 \x03(\tB*\xe0\x41\x01\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x80\x01\n\x19ListTopicSnapshotsRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\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\"R\n\x1aListTopicSnapshotsResponse\x12\x16\n\tsnapshots\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"H\n\x12\x44\x65leteTopicRequest\x12\x32\n\x05topic\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\"]\n\x19\x44\x65tachSubscriptionRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\"\x1c\n\x1a\x44\x65tachSubscriptionResponse\"\xef\x08\n\x0cSubscription\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x32\n\x05topic\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x36\n\x0bpush_config\x18\x04 \x01(\x0b\x32\x1c.google.pubsub.v1.PushConfigB\x03\xe0\x41\x01\x12>\n\x0f\x62igquery_config\x18\x12 \x01(\x0b\x32 .google.pubsub.v1.BigQueryConfigB\x03\xe0\x41\x01\x12G\n\x14\x63loud_storage_config\x18\x16 \x01(\x0b\x32$.google.pubsub.v1.CloudStorageConfigB\x03\xe0\x41\x01\x12!\n\x14\x61\x63k_deadline_seconds\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x15retain_acked_messages\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x1amessage_retention_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12?\n\x06labels\x18\t \x03(\x0b\x32*.google.pubsub.v1.Subscription.LabelsEntryB\x03\xe0\x41\x01\x12$\n\x17\x65nable_message_ordering\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x11\x65xpiration_policy\x18\x0b \x01(\x0b\x32\".google.pubsub.v1.ExpirationPolicyB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\x43\n\x12\x64\x65\x61\x64_letter_policy\x18\r \x01(\x0b\x32\".google.pubsub.v1.DeadLetterPolicyB\x03\xe0\x41\x01\x12\x38\n\x0cretry_policy\x18\x0e \x01(\x0b\x32\x1d.google.pubsub.v1.RetryPolicyB\x03\xe0\x41\x01\x12\x15\n\x08\x64\x65tached\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_exactly_once_delivery\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12H\n topic_message_retention_duration\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x38\n\x05state\x18\x13 \x01(\x0e\x32$.google.pubsub.v1.Subscription.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\">\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x12\n\x0eRESOURCE_ERROR\x10\x02:X\xea\x41U\n\"pubsub.googleapis.com/Subscription\x12/projects/{project}/subscriptions/{subscription}\"\x7f\n\x0bRetryPolicy\x12\x37\n\x0fminimum_backoff\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x0fmaximum_backoff\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"V\n\x10\x44\x65\x61\x64LetterPolicy\x12\x1e\n\x11\x64\x65\x61\x64_letter_topic\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15max_delivery_attempts\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"?\n\x10\x45xpirationPolicy\x12+\n\x03ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\x9a\x04\n\nPushConfig\x12\x1a\n\rpush_endpoint\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\nattributes\x18\x02 \x03(\x0b\x32,.google.pubsub.v1.PushConfig.AttributesEntryB\x03\xe0\x41\x01\x12\x41\n\noidc_token\x18\x03 \x01(\x0b\x32&.google.pubsub.v1.PushConfig.OidcTokenB\x03\xe0\x41\x01H\x00\x12I\n\x0epubsub_wrapper\x18\x04 \x01(\x0b\x32*.google.pubsub.v1.PushConfig.PubsubWrapperB\x03\xe0\x41\x01H\x01\x12\x41\n\nno_wrapper\x18\x05 \x01(\x0b\x32&.google.pubsub.v1.PushConfig.NoWrapperB\x03\xe0\x41\x01H\x01\x1a\x46\n\tOidcToken\x12\"\n\x15service_account_email\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x61udience\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\x0f\n\rPubsubWrapper\x1a(\n\tNoWrapper\x12\x1b\n\x0ewrite_metadata\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x17\n\x15\x61uthentication_methodB\t\n\x07wrapper\"\x8e\x03\n\x0e\x42igQueryConfig\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10use_topic_schema\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1b\n\x0ewrite_metadata\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13\x64rop_unknown_fields\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12:\n\x05state\x18\x05 \x01(\x0e\x32&.google.pubsub.v1.BigQueryConfig.StateB\x03\xe0\x41\x03\x12\x1d\n\x10use_table_schema\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\"\n\x15service_account_email\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x8a\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\r\n\tNOT_FOUND\x10\x03\x12\x13\n\x0fSCHEMA_MISMATCH\x10\x04\x12#\n\x1fIN_TRANSIT_LOCATION_RESTRICTION\x10\x05\"\xe9\x05\n\x12\x43loudStorageConfig\x12\x13\n\x06\x62ucket\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66ilename_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x66ilename_suffix\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x66ilename_datetime_format\x18\n \x01(\tB\x03\xe0\x41\x01\x12K\n\x0btext_config\x18\x04 \x01(\x0b\x32/.google.pubsub.v1.CloudStorageConfig.TextConfigB\x03\xe0\x41\x01H\x00\x12K\n\x0b\x61vro_config\x18\x05 \x01(\x0b\x32/.google.pubsub.v1.CloudStorageConfig.AvroConfigB\x03\xe0\x41\x01H\x00\x12\x34\n\x0cmax_duration\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x16\n\tmax_bytes\x18\x07 \x01(\x03\x42\x03\xe0\x41\x01\x12\x19\n\x0cmax_messages\x18\x08 \x01(\x03\x42\x03\xe0\x41\x01\x12>\n\x05state\x18\t \x01(\x0e\x32*.google.pubsub.v1.CloudStorageConfig.StateB\x03\xe0\x41\x03\x12\"\n\x15service_account_email\x18\x0b \x01(\tB\x03\xe0\x41\x01\x1a\x0c\n\nTextConfig\x1aH\n\nAvroConfig\x12\x1b\n\x0ewrite_metadata\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x10use_topic_schema\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\r\n\tNOT_FOUND\x10\x03\x12#\n\x1fIN_TRANSIT_LOCATION_RESTRICTION\x10\x04\x12\x13\n\x0fSCHEMA_MISMATCH\x10\x05\x42\x0f\n\routput_format\"|\n\x0fReceivedMessage\x12\x13\n\x06\x61\x63k_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x35\n\x07message\x18\x02 \x01(\x0b\x32\x1f.google.pubsub.v1.PubsubMessageB\x03\xe0\x41\x01\x12\x1d\n\x10\x64\x65livery_attempt\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"Z\n\x16GetSubscriptionRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\"\x8c\x01\n\x19UpdateSubscriptionRequest\x12\x39\n\x0csubscription\x18\x01 \x01(\x0b\x32\x1e.google.pubsub.v1.SubscriptionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x91\x01\n\x18ListSubscriptionsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"u\n\x19ListSubscriptionsResponse\x12:\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x1e.google.pubsub.v1.SubscriptionB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"]\n\x19\x44\x65leteSubscriptionRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\"\x93\x01\n\x17ModifyPushConfigRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x36\n\x0bpush_config\x18\x02 \x01(\x0b\x32\x1c.google.pubsub.v1.PushConfigB\x03\xe0\x41\x02\"\x8d\x01\n\x0bPullRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12!\n\x12return_immediately\x18\x02 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x19\n\x0cmax_messages\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"Q\n\x0cPullResponse\x12\x41\n\x11received_messages\x18\x01 \x03(\x0b\x32!.google.pubsub.v1.ReceivedMessageB\x03\xe0\x41\x01\"\x95\x01\n\x18ModifyAckDeadlineRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x14\n\x07\x61\x63k_ids\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12!\n\x14\x61\x63k_deadline_seconds\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\"l\n\x12\x41\x63knowledgeRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x14\n\x07\x61\x63k_ids\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xc7\x02\n\x14StreamingPullRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12\x14\n\x07\x61\x63k_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12$\n\x17modify_deadline_seconds\x18\x03 \x03(\x05\x42\x03\xe0\x41\x01\x12$\n\x17modify_deadline_ack_ids\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12(\n\x1bstream_ack_deadline_seconds\x18\x05 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\tclient_id\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18max_outstanding_messages\x18\x07 \x01(\x03\x42\x03\xe0\x41\x01\x12\"\n\x15max_outstanding_bytes\x18\x08 \x01(\x03\x42\x03\xe0\x41\x01\"\x9e\x06\n\x15StreamingPullResponse\x12\x41\n\x11received_messages\x18\x01 \x03(\x0b\x32!.google.pubsub.v1.ReceivedMessageB\x03\xe0\x41\x01\x12\x66\n\x18\x61\x63knowledge_confirmation\x18\x05 \x01(\x0b\x32?.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmationB\x03\xe0\x41\x01\x12t\n modify_ack_deadline_confirmation\x18\x03 \x01(\x0b\x32\x45.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmationB\x03\xe0\x41\x01\x12\x64\n\x17subscription_properties\x18\x04 \x01(\x0b\x32>.google.pubsub.v1.StreamingPullResponse.SubscriptionPropertiesB\x03\xe0\x41\x01\x1a\x94\x01\n\x17\x41\x63knowledgeConfirmation\x12\x14\n\x07\x61\x63k_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0finvalid_ack_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1e\n\x11unordered_ack_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12%\n\x18temporary_failed_ack_ids\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1az\n\x1dModifyAckDeadlineConfirmation\x12\x14\n\x07\x61\x63k_ids\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0finvalid_ack_ids\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12%\n\x18temporary_failed_ack_ids\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1ak\n\x16SubscriptionProperties\x12*\n\x1d\x65xactly_once_delivery_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12%\n\x18message_ordering_enabled\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x02\n\x15\x43reateSnapshotRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1epubsub.googleapis.com/Snapshot\x12@\n\x0csubscription\x18\x02 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12H\n\x06labels\x18\x03 \x03(\x0b\x32\x33.google.pubsub.v1.CreateSnapshotRequest.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\"\x80\x01\n\x15UpdateSnapshotRequest\x12\x31\n\x08snapshot\x18\x01 \x01(\x0b\x32\x1a.google.pubsub.v1.SnapshotB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xc1\x02\n\x08Snapshot\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x32\n\x05topic\x18\x02 \x01(\tB#\xe0\x41\x01\xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12;\n\x06labels\x18\x04 \x03(\x0b\x32&.google.pubsub.v1.Snapshot.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:L\xea\x41I\n\x1epubsub.googleapis.com/Snapshot\x12\'projects/{project}/snapshots/{snapshot}\"N\n\x12GetSnapshotRequest\x12\x38\n\x08snapshot\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1epubsub.googleapis.com/Snapshot\"\x8d\x01\n\x14ListSnapshotsRequest\x12\x44\n\x07project\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"i\n\x15ListSnapshotsResponse\x12\x32\n\tsnapshots\x18\x01 \x03(\x0b\x32\x1a.google.pubsub.v1.SnapshotB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x15\x44\x65leteSnapshotRequest\x12\x38\n\x08snapshot\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1epubsub.googleapis.com/Snapshot\"\xc6\x01\n\x0bSeekRequest\x12@\n\x0csubscription\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"pubsub.googleapis.com/Subscription\x12/\n\x04time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12:\n\x08snapshot\x18\x03 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1epubsub.googleapis.com/SnapshotH\x00\x42\x08\n\x06target\"\x0e\n\x0cSeekResponse2\xb8\x0b\n\tPublisher\x12q\n\x0b\x43reateTopic\x12\x17.google.pubsub.v1.Topic\x1a\x17.google.pubsub.v1.Topic\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x1a\x1e/v1/{name=projects/*/topics/*}:\x01*\x12\x91\x01\n\x0bUpdateTopic\x12$.google.pubsub.v1.UpdateTopicRequest\x1a\x17.google.pubsub.v1.Topic\"C\xda\x41\x11topic,update_mask\x82\xd3\xe4\x93\x02)2$/v1/{topic.name=projects/*/topics/*}:\x01*\x12\x93\x01\n\x07Publish\x12 .google.pubsub.v1.PublishRequest\x1a!.google.pubsub.v1.PublishResponse\"C\xda\x41\x0etopic,messages\x82\xd3\xe4\x93\x02,\"\'/v1/{topic=projects/*/topics/*}:publish:\x01*\x12w\n\x08GetTopic\x12!.google.pubsub.v1.GetTopicRequest\x1a\x17.google.pubsub.v1.Topic\"/\xda\x41\x05topic\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{topic=projects/*/topics/*}\x12\x8a\x01\n\nListTopics\x12#.google.pubsub.v1.ListTopicsRequest\x1a$.google.pubsub.v1.ListTopicsResponse\"1\xda\x41\x07project\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{project=projects/*}/topics\x12\xba\x01\n\x16ListTopicSubscriptions\x12/.google.pubsub.v1.ListTopicSubscriptionsRequest\x1a\x30.google.pubsub.v1.ListTopicSubscriptionsResponse\"=\xda\x41\x05topic\x82\xd3\xe4\x93\x02/\x12-/v1/{topic=projects/*/topics/*}/subscriptions\x12\xaa\x01\n\x12ListTopicSnapshots\x12+.google.pubsub.v1.ListTopicSnapshotsRequest\x1a,.google.pubsub.v1.ListTopicSnapshotsResponse\"9\xda\x41\x05topic\x82\xd3\xe4\x93\x02+\x12)/v1/{topic=projects/*/topics/*}/snapshots\x12|\n\x0b\x44\x65leteTopic\x12$.google.pubsub.v1.DeleteTopicRequest\x1a\x16.google.protobuf.Empty\"/\xda\x41\x05topic\x82\xd3\xe4\x93\x02!*\x1f/v1/{topic=projects/*/topics/*}\x12\xad\x01\n\x12\x44\x65tachSubscription\x12+.google.pubsub.v1.DetachSubscriptionRequest\x1a,.google.pubsub.v1.DetachSubscriptionResponse\"<\x82\xd3\xe4\x93\x02\x36\"4/v1/{subscription=projects/*/subscriptions/*}:detach\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub2\xd2\x15\n\nSubscriber\x12\xb4\x01\n\x12\x43reateSubscription\x12\x1e.google.pubsub.v1.Subscription\x1a\x1e.google.pubsub.v1.Subscription\"^\xda\x41+name,topic,push_config,ack_deadline_seconds\x82\xd3\xe4\x93\x02*\x1a%/v1/{name=projects/*/subscriptions/*}:\x01*\x12\xa1\x01\n\x0fGetSubscription\x12(.google.pubsub.v1.GetSubscriptionRequest\x1a\x1e.google.pubsub.v1.Subscription\"D\xda\x41\x0csubscription\x82\xd3\xe4\x93\x02/\x12-/v1/{subscription=projects/*/subscriptions/*}\x12\xbb\x01\n\x12UpdateSubscription\x12+.google.pubsub.v1.UpdateSubscriptionRequest\x1a\x1e.google.pubsub.v1.Subscription\"X\xda\x41\x18subscription,update_mask\x82\xd3\xe4\x93\x02\x37\x32\x32/v1/{subscription.name=projects/*/subscriptions/*}:\x01*\x12\xa6\x01\n\x11ListSubscriptions\x12*.google.pubsub.v1.ListSubscriptionsRequest\x1a+.google.pubsub.v1.ListSubscriptionsResponse\"8\xda\x41\x07project\x82\xd3\xe4\x93\x02(\x12&/v1/{project=projects/*}/subscriptions\x12\x9f\x01\n\x12\x44\x65leteSubscription\x12+.google.pubsub.v1.DeleteSubscriptionRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x0csubscription\x82\xd3\xe4\x93\x02/*-/v1/{subscription=projects/*/subscriptions/*}\x12\xcf\x01\n\x11ModifyAckDeadline\x12*.google.pubsub.v1.ModifyAckDeadlineRequest\x1a\x16.google.protobuf.Empty\"v\xda\x41)subscription,ack_ids,ack_deadline_seconds\x82\xd3\xe4\x93\x02\x44\"?/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline:\x01*\x12\xa8\x01\n\x0b\x41\x63knowledge\x12$.google.pubsub.v1.AcknowledgeRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x14subscription,ack_ids\x82\xd3\xe4\x93\x02>\"9/v1/{subscription=projects/*/subscriptions/*}:acknowledge:\x01*\x12\xd0\x01\n\x04Pull\x12\x1d.google.pubsub.v1.PullRequest\x1a\x1e.google.pubsub.v1.PullResponse\"\x88\x01\xda\x41,subscription,return_immediately,max_messages\xda\x41\x19subscription,max_messages\x82\xd3\xe4\x93\x02\x37\"2/v1/{subscription=projects/*/subscriptions/*}:pull:\x01*\x12\x66\n\rStreamingPull\x12&.google.pubsub.v1.StreamingPullRequest\x1a\'.google.pubsub.v1.StreamingPullResponse\"\x00(\x01\x30\x01\x12\xbb\x01\n\x10ModifyPushConfig\x12).google.pubsub.v1.ModifyPushConfigRequest\x1a\x16.google.protobuf.Empty\"d\xda\x41\x18subscription,push_config\x82\xd3\xe4\x93\x02\x43\">/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig:\x01*\x12\x89\x01\n\x0bGetSnapshot\x12$.google.pubsub.v1.GetSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot\"8\xda\x41\x08snapshot\x82\xd3\xe4\x93\x02\'\x12%/v1/{snapshot=projects/*/snapshots/*}\x12\x96\x01\n\rListSnapshots\x12&.google.pubsub.v1.ListSnapshotsRequest\x1a\'.google.pubsub.v1.ListSnapshotsResponse\"4\xda\x41\x07project\x82\xd3\xe4\x93\x02$\x12\"/v1/{project=projects/*}/snapshots\x12\x97\x01\n\x0e\x43reateSnapshot\x12\'.google.pubsub.v1.CreateSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot\"@\xda\x41\x11name,subscription\x82\xd3\xe4\x93\x02&\x1a!/v1/{name=projects/*/snapshots/*}:\x01*\x12\xa3\x01\n\x0eUpdateSnapshot\x12\'.google.pubsub.v1.UpdateSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot\"L\xda\x41\x14snapshot,update_mask\x82\xd3\xe4\x93\x02/2*/v1/{snapshot.name=projects/*/snapshots/*}:\x01*\x12\x8b\x01\n\x0e\x44\x65leteSnapshot\x12\'.google.pubsub.v1.DeleteSnapshotRequest\x1a\x16.google.protobuf.Empty\"8\xda\x41\x08snapshot\x82\xd3\xe4\x93\x02\'*%/v1/{snapshot=projects/*/snapshots/*}\x12\x84\x01\n\x04Seek\x12\x1d.google.pubsub.v1.SeekRequest\x1a\x1e.google.pubsub.v1.SeekResponse\"=\x82\xd3\xe4\x93\x02\x37\"2/v1/{subscription=projects/*/subscriptions/*}:seek:\x01*\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsubB\xaa\x01\n\x14\x63om.google.pubsub.v1B\x0bPubsubProtoP\x01Z2cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb\xf8\x01\x01\xaa\x02\x16Google.Cloud.PubSub.V1\xca\x02\x16Google\\Cloud\\PubSub\\V1\xea\x02\x19Google::Cloud::PubSub::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.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 PubSub - module V1 - MessageStoragePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.MessageStoragePolicy").msgclass - SchemaSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SchemaSettings").msgclass - IngestionDataSourceSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.IngestionDataSourceSettings").msgclass - IngestionDataSourceSettings::AwsKinesis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis").msgclass - IngestionDataSourceSettings::AwsKinesis::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.IngestionDataSourceSettings.AwsKinesis.State").enummodule - Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Topic").msgclass - Topic::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Topic.State").enummodule - PubsubMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PubsubMessage").msgclass - GetTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetTopicRequest").msgclass - UpdateTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateTopicRequest").msgclass - PublishRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PublishRequest").msgclass - PublishResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PublishResponse").msgclass - ListTopicsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicsRequest").msgclass - ListTopicsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicsResponse").msgclass - ListTopicSubscriptionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSubscriptionsRequest").msgclass - ListTopicSubscriptionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSubscriptionsResponse").msgclass - ListTopicSnapshotsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSnapshotsRequest").msgclass - ListTopicSnapshotsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListTopicSnapshotsResponse").msgclass - DeleteTopicRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteTopicRequest").msgclass - DetachSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DetachSubscriptionRequest").msgclass - DetachSubscriptionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DetachSubscriptionResponse").msgclass - Subscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Subscription").msgclass - Subscription::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Subscription.State").enummodule - RetryPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.RetryPolicy").msgclass - DeadLetterPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeadLetterPolicy").msgclass - ExpirationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ExpirationPolicy").msgclass - PushConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig").msgclass - PushConfig::OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig.OidcToken").msgclass - PushConfig::PubsubWrapper = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig.PubsubWrapper").msgclass - PushConfig::NoWrapper = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PushConfig.NoWrapper").msgclass - BigQueryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.BigQueryConfig").msgclass - BigQueryConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.BigQueryConfig.State").enummodule - CloudStorageConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig").msgclass - CloudStorageConfig::TextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig.TextConfig").msgclass - CloudStorageConfig::AvroConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig.AvroConfig").msgclass - CloudStorageConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CloudStorageConfig.State").enummodule - ReceivedMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ReceivedMessage").msgclass - GetSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSubscriptionRequest").msgclass - UpdateSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateSubscriptionRequest").msgclass - ListSubscriptionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsRequest").msgclass - ListSubscriptionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSubscriptionsResponse").msgclass - DeleteSubscriptionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSubscriptionRequest").msgclass - ModifyPushConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ModifyPushConfigRequest").msgclass - PullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PullRequest").msgclass - PullResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.PullResponse").msgclass - ModifyAckDeadlineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ModifyAckDeadlineRequest").msgclass - AcknowledgeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.AcknowledgeRequest").msgclass - StreamingPullRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullRequest").msgclass - StreamingPullResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse").msgclass - StreamingPullResponse::AcknowledgeConfirmation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation").msgclass - StreamingPullResponse::ModifyAckDeadlineConfirmation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation").msgclass - StreamingPullResponse::SubscriptionProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.StreamingPullResponse.SubscriptionProperties").msgclass - CreateSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSnapshotRequest").msgclass - UpdateSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.UpdateSnapshotRequest").msgclass - Snapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Snapshot").msgclass - GetSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSnapshotRequest").msgclass - ListSnapshotsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSnapshotsRequest").msgclass - ListSnapshotsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSnapshotsResponse").msgclass - DeleteSnapshotRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSnapshotRequest").msgclass - SeekRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SeekRequest").msgclass - SeekResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SeekResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb deleted file mode 100644 index 18260902c766..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/pubsub_services_pb.rb +++ /dev/null @@ -1,203 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/pubsub/v1/pubsub.proto for package 'Google.Cloud.PubSub.V1' -# Original file comments: -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/pubsub/v1/pubsub_pb' - -module Google - module Cloud - module PubSub - module V1 - module Publisher - # The service that an application uses to manipulate topics, and to send - # messages to a topic. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.pubsub.v1.Publisher' - - # Creates the given topic with the given name. See the [resource name rules] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - rpc :CreateTopic, ::Google::Cloud::PubSub::V1::Topic, ::Google::Cloud::PubSub::V1::Topic - # Updates an existing topic by updating the fields specified in the update - # mask. Note that certain properties of a topic are not modifiable. - rpc :UpdateTopic, ::Google::Cloud::PubSub::V1::UpdateTopicRequest, ::Google::Cloud::PubSub::V1::Topic - # Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - # does not exist. - rpc :Publish, ::Google::Cloud::PubSub::V1::PublishRequest, ::Google::Cloud::PubSub::V1::PublishResponse - # Gets the configuration of a topic. - rpc :GetTopic, ::Google::Cloud::PubSub::V1::GetTopicRequest, ::Google::Cloud::PubSub::V1::Topic - # Lists matching topics. - rpc :ListTopics, ::Google::Cloud::PubSub::V1::ListTopicsRequest, ::Google::Cloud::PubSub::V1::ListTopicsResponse - # Lists the names of the attached subscriptions on this topic. - rpc :ListTopicSubscriptions, ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse - # Lists the names of the snapshots on this topic. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - rpc :ListTopicSnapshots, ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse - # Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - # does not exist. After a topic is deleted, a new topic may be created with - # the same name; this is an entirely new topic with none of the old - # configuration or subscriptions. Existing subscriptions to this topic are - # not deleted, but their `topic` field is set to `_deleted-topic_`. - rpc :DeleteTopic, ::Google::Cloud::PubSub::V1::DeleteTopicRequest, ::Google::Protobuf::Empty - # Detaches a subscription from this topic. All messages retained in the - # subscription are dropped. Subsequent `Pull` and `StreamingPull` requests - # will return FAILED_PRECONDITION. If the subscription is a push - # subscription, pushes to the endpoint will stop. - rpc :DetachSubscription, ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse - end - - Stub = Service.rpc_stub_class - end - module Subscriber - # The service that an application uses to manipulate subscriptions and to - # consume messages from a subscription via the `Pull` method or by - # establishing a bi-directional stream using the `StreamingPull` method. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.pubsub.v1.Subscriber' - - # Creates a subscription to a given topic. See the [resource name rules] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - # If the subscription already exists, returns `ALREADY_EXISTS`. - # If the corresponding topic doesn't exist, returns `NOT_FOUND`. - # - # If the name is not provided in the request, the server will assign a random - # name for this subscription on the same project as the topic, conforming - # to the [resource name format] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - # generated name is populated in the returned Subscription object. Note that - # for REST API requests, you must specify a name in the request. - rpc :CreateSubscription, ::Google::Cloud::PubSub::V1::Subscription, ::Google::Cloud::PubSub::V1::Subscription - # Gets the configuration details of a subscription. - rpc :GetSubscription, ::Google::Cloud::PubSub::V1::GetSubscriptionRequest, ::Google::Cloud::PubSub::V1::Subscription - # Updates an existing subscription by updating the fields specified in the - # update mask. Note that certain properties of a subscription, such as its - # topic, are not modifiable. - rpc :UpdateSubscription, ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, ::Google::Cloud::PubSub::V1::Subscription - # Lists matching subscriptions. - rpc :ListSubscriptions, ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, ::Google::Cloud::PubSub::V1::ListSubscriptionsResponse - # Deletes an existing subscription. All messages retained in the subscription - # are immediately dropped. Calls to `Pull` after deletion will return - # `NOT_FOUND`. After a subscription is deleted, a new one may be created with - # the same name, but the new one has no association with the old - # subscription or its topic unless the same topic is specified. - rpc :DeleteSubscription, ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, ::Google::Protobuf::Empty - # Modifies the ack deadline for a specific message. This method is useful - # to indicate that more time is needed to process a message by the - # subscriber, or to make the message available for redelivery if the - # processing was interrupted. Note that this does not modify the - # subscription-level `ackDeadlineSeconds` used for subsequent messages. - rpc :ModifyAckDeadline, ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, ::Google::Protobuf::Empty - # Acknowledges the messages associated with the `ack_ids` in the - # `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - # from the subscription. - # - # Acknowledging a message whose ack deadline has expired may succeed, - # but such a message may be redelivered later. Acknowledging a message more - # than once will not result in an error. - rpc :Acknowledge, ::Google::Cloud::PubSub::V1::AcknowledgeRequest, ::Google::Protobuf::Empty - # Pulls messages from the server. - rpc :Pull, ::Google::Cloud::PubSub::V1::PullRequest, ::Google::Cloud::PubSub::V1::PullResponse - # Establishes a stream with the server, which sends messages down to the - # client. The client streams acknowledgements and ack deadline modifications - # back to the server. The server will close the stream and return the status - # on any error. The server may close the stream with status `UNAVAILABLE` to - # reassign server-side resources, in which case, the client should - # re-establish the stream. Flow control can be achieved by configuring the - # underlying RPC channel. - rpc :StreamingPull, stream(::Google::Cloud::PubSub::V1::StreamingPullRequest), stream(::Google::Cloud::PubSub::V1::StreamingPullResponse) - # Modifies the `PushConfig` for a specified subscription. - # - # This may be used to change a push subscription to a pull one (signified by - # an empty `PushConfig`) or vice versa, or change the endpoint URL and other - # attributes of a push subscription. Messages will accumulate for delivery - # continuously through the call regardless of changes to the `PushConfig`. - rpc :ModifyPushConfig, ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, ::Google::Protobuf::Empty - # Gets the configuration details of a snapshot. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - rpc :GetSnapshot, ::Google::Cloud::PubSub::V1::GetSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot - # Lists the existing snapshots. Snapshots are used in [Seek]( - # https://cloud.google.com/pubsub/docs/replay-overview) operations, which - # allow you to manage message acknowledgments in bulk. That is, you can set - # the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - rpc :ListSnapshots, ::Google::Cloud::PubSub::V1::ListSnapshotsRequest, ::Google::Cloud::PubSub::V1::ListSnapshotsResponse - # Creates a snapshot from the requested subscription. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # If the snapshot already exists, returns `ALREADY_EXISTS`. - # If the requested subscription doesn't exist, returns `NOT_FOUND`. - # If the backlog in the subscription is too old -- and the resulting snapshot - # would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - # See also the `Snapshot.expire_time` field. If the name is not provided in - # the request, the server will assign a random - # name for this snapshot on the same project as the subscription, conforming - # to the [resource name format] - # (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The - # generated name is populated in the returned Snapshot object. Note that for - # REST API requests, you must specify a name in the request. - rpc :CreateSnapshot, ::Google::Cloud::PubSub::V1::CreateSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot - # Updates an existing snapshot by updating the fields specified in the update - # mask. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, - # which allow you to manage message acknowledgments in bulk. That is, you can - # set the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - rpc :UpdateSnapshot, ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, ::Google::Cloud::PubSub::V1::Snapshot - # Removes an existing snapshot. Snapshots are used in [Seek] - # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - # allow you to manage message acknowledgments in bulk. That is, you can set - # the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. - # When the snapshot is deleted, all messages retained in the snapshot - # are immediately dropped. After a snapshot is deleted, a new one may be - # created with the same name, but the new one has no association with the old - # snapshot or its subscription, unless the same subscription is specified. - rpc :DeleteSnapshot, ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, ::Google::Protobuf::Empty - # Seeks an existing subscription to a point in time or to a given snapshot, - # whichever is provided in the request. Snapshots are used in [Seek] - # (https://cloud.google.com/pubsub/docs/replay-overview) operations, which - # allow you to manage message acknowledgments in bulk. That is, you can set - # the acknowledgment state of messages in an existing subscription to the - # state captured by a snapshot. Note that both the subscription and the - # snapshot must be on the same topic. - rpc :Seek, ::Google::Cloud::PubSub::V1::SeekRequest, ::Google::Cloud::PubSub::V1::SeekResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb deleted file mode 100644 index 07b3ef8491c0..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/pubsub/v1/schema.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\x1dgoogle/pubsub/v1/schema.proto\x12\x10google.pubsub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x02\n\x06Schema\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12+\n\x04type\x18\x02 \x01(\x0e\x32\x1d.google.pubsub.v1.Schema.Type\x12\x12\n\ndefinition\x18\x03 \x01(\t\x12\x1b\n\x0brevision_id\x18\x04 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12=\n\x14revision_create_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fPROTOCOL_BUFFER\x10\x01\x12\x08\n\x04\x41VRO\x10\x02:F\xea\x41\x43\n\x1cpubsub.googleapis.com/Schema\x12#projects/{project}/schemas/{schema}\"\x8d\x01\n\x13\x43reateSchemaRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\x12\x1cpubsub.googleapis.com/Schema\x12-\n\x06schema\x18\x02 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaB\x03\xe0\x41\x02\x12\x11\n\tschema_id\x18\x03 \x01(\t\"r\n\x10GetSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12*\n\x04view\x18\x02 \x01(\x0e\x32\x1c.google.pubsub.v1.SchemaView\"\xac\x01\n\x12ListSchemasRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12*\n\x04view\x18\x02 \x01(\x0e\x32\x1c.google.pubsub.v1.SchemaView\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"Y\n\x13ListSchemasResponse\x12)\n\x07schemas\x18\x01 \x03(\x0b\x32\x18.google.pubsub.v1.Schema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa3\x01\n\x1aListSchemaRevisionsRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12*\n\x04view\x18\x02 \x01(\x0e\x32\x1c.google.pubsub.v1.SchemaView\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"a\n\x1bListSchemaRevisionsResponse\x12)\n\x07schemas\x18\x01 \x03(\x0b\x32\x18.google.pubsub.v1.Schema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"x\n\x13\x43ommitSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12-\n\x06schema\x18\x02 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaB\x03\xe0\x41\x02\"e\n\x15RollbackSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12\x18\n\x0brevision_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"m\n\x1b\x44\x65leteSchemaRevisionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\x12\x1a\n\x0brevision_id\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x01\"I\n\x13\x44\x65leteSchemaRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1cpubsub.googleapis.com/Schema\"\x8b\x01\n\x15ValidateSchemaRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12-\n\x06schema\x18\x02 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaB\x03\xe0\x41\x02\"\x18\n\x16ValidateSchemaResponse\"\x8a\x02\n\x16ValidateMessageRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x31\n\x04name\x18\x02 \x01(\tB!\xfa\x41\x1e\n\x1cpubsub.googleapis.com/SchemaH\x00\x12*\n\x06schema\x18\x03 \x01(\x0b\x32\x18.google.pubsub.v1.SchemaH\x00\x12\x0f\n\x07message\x18\x04 \x01(\x0c\x12,\n\x08\x65ncoding\x18\x05 \x01(\x0e\x32\x1a.google.pubsub.v1.EncodingB\r\n\x0bschema_spec\"\x19\n\x17ValidateMessageResponse*>\n\nSchemaView\x12\x1b\n\x17SCHEMA_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02*:\n\x08\x45ncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\n\n\x06\x42INARY\x10\x02\x32\x88\r\n\rSchemaService\x12\x9a\x01\n\x0c\x43reateSchema\x12%.google.pubsub.v1.CreateSchemaRequest\x1a\x18.google.pubsub.v1.Schema\"I\xda\x41\x17parent,schema,schema_id\x82\xd3\xe4\x93\x02)\"\x1f/v1/{parent=projects/*}/schemas:\x06schema\x12y\n\tGetSchema\x12\".google.pubsub.v1.GetSchemaRequest\x1a\x18.google.pubsub.v1.Schema\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{name=projects/*/schemas/*}\x12\x8c\x01\n\x0bListSchemas\x12$.google.pubsub.v1.ListSchemasRequest\x1a%.google.pubsub.v1.ListSchemasResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{parent=projects/*}/schemas\x12\xb0\x01\n\x13ListSchemaRevisions\x12,.google.pubsub.v1.ListSchemaRevisionsRequest\x1a-.google.pubsub.v1.ListSchemaRevisionsResponse\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/schemas/*}:listRevisions\x12\x90\x01\n\x0c\x43ommitSchema\x12%.google.pubsub.v1.CommitSchemaRequest\x1a\x18.google.pubsub.v1.Schema\"?\xda\x41\x0bname,schema\x82\xd3\xe4\x93\x02+\"&/v1/{name=projects/*/schemas/*}:commit:\x01*\x12\x9b\x01\n\x0eRollbackSchema\x12\'.google.pubsub.v1.RollbackSchemaRequest\x1a\x18.google.pubsub.v1.Schema\"F\xda\x41\x10name,revision_id\x82\xd3\xe4\x93\x02-\"(/v1/{name=projects/*/schemas/*}:rollback:\x01*\x12\xaa\x01\n\x14\x44\x65leteSchemaRevision\x12-.google.pubsub.v1.DeleteSchemaRevisionRequest\x1a\x18.google.pubsub.v1.Schema\"I\xda\x41\x10name,revision_id\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/schemas/*}:deleteRevision\x12}\n\x0c\x44\x65leteSchema\x12%.google.pubsub.v1.DeleteSchemaRequest\x1a\x16.google.protobuf.Empty\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!*\x1f/v1/{name=projects/*/schemas/*}\x12\xa8\x01\n\x0eValidateSchema\x12\'.google.pubsub.v1.ValidateSchemaRequest\x1a(.google.pubsub.v1.ValidateSchemaResponse\"C\xda\x41\rparent,schema\x82\xd3\xe4\x93\x02-\"(/v1/{parent=projects/*}/schemas:validate:\x01*\x12\xa2\x01\n\x0fValidateMessage\x12(.google.pubsub.v1.ValidateMessageRequest\x1a).google.pubsub.v1.ValidateMessageResponse\":\x82\xd3\xe4\x93\x02\x34\"//v1/{parent=projects/*}/schemas:validateMessage:\x01*\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsubB\xaa\x01\n\x14\x63om.google.pubsub.v1B\x0bSchemaProtoP\x01Z2cloud.google.com/go/pubsub/apiv1/pubsubpb;pubsubpb\xf8\x01\x01\xaa\x02\x16Google.Cloud.PubSub.V1\xca\x02\x16Google\\Cloud\\PubSub\\V1\xea\x02\x19Google::Cloud::PubSub::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module PubSub - module V1 - Schema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Schema").msgclass - Schema::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Schema.Type").enummodule - CreateSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CreateSchemaRequest").msgclass - GetSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.GetSchemaRequest").msgclass - ListSchemasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemasRequest").msgclass - ListSchemasResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemasResponse").msgclass - ListSchemaRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemaRevisionsRequest").msgclass - ListSchemaRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ListSchemaRevisionsResponse").msgclass - CommitSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.CommitSchemaRequest").msgclass - RollbackSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.RollbackSchemaRequest").msgclass - DeleteSchemaRevisionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSchemaRevisionRequest").msgclass - DeleteSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.DeleteSchemaRequest").msgclass - ValidateSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateSchemaRequest").msgclass - ValidateSchemaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateSchemaResponse").msgclass - ValidateMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateMessageRequest").msgclass - ValidateMessageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.ValidateMessageResponse").msgclass - SchemaView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.SchemaView").enummodule - Encoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.pubsub.v1.Encoding").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb b/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb deleted file mode 100644 index 970d2f67bece..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/lib/google/pubsub/v1/schema_services_pb.rb +++ /dev/null @@ -1,63 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/pubsub/v1/schema.proto for package 'Google.Cloud.PubSub.V1' -# Original file comments: -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/pubsub/v1/schema_pb' - -module Google - module Cloud - module PubSub - module V1 - module SchemaService - # Service for doing schema-related operations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.pubsub.v1.SchemaService' - - # Creates a schema. - rpc :CreateSchema, ::Google::Cloud::PubSub::V1::CreateSchemaRequest, ::Google::Cloud::PubSub::V1::Schema - # Gets a schema. - rpc :GetSchema, ::Google::Cloud::PubSub::V1::GetSchemaRequest, ::Google::Cloud::PubSub::V1::Schema - # Lists schemas in a project. - rpc :ListSchemas, ::Google::Cloud::PubSub::V1::ListSchemasRequest, ::Google::Cloud::PubSub::V1::ListSchemasResponse - # Lists all schema revisions for the named schema. - rpc :ListSchemaRevisions, ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest, ::Google::Cloud::PubSub::V1::ListSchemaRevisionsResponse - # Commits a new schema revision to an existing schema. - rpc :CommitSchema, ::Google::Cloud::PubSub::V1::CommitSchemaRequest, ::Google::Cloud::PubSub::V1::Schema - # Creates a new schema revision that is a copy of the provided revision_id. - rpc :RollbackSchema, ::Google::Cloud::PubSub::V1::RollbackSchemaRequest, ::Google::Cloud::PubSub::V1::Schema - # Deletes a specific schema revision. - rpc :DeleteSchemaRevision, ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest, ::Google::Cloud::PubSub::V1::Schema - # Deletes a schema. - rpc :DeleteSchema, ::Google::Cloud::PubSub::V1::DeleteSchemaRequest, ::Google::Protobuf::Empty - # Validates a schema. - rpc :ValidateSchema, ::Google::Cloud::PubSub::V1::ValidateSchemaRequest, ::Google::Cloud::PubSub::V1::ValidateSchemaResponse - # Validates a message against a schema. - rpc :ValidateMessage, ::Google::Cloud::PubSub::V1::ValidateMessageRequest, ::Google::Cloud::PubSub::V1::ValidateMessageResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md deleted file mode 100644 index cd58273f15b1..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Pub/Sub 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-pubsub-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 2223d8935069..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,420 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index b03587481349..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 38b4b61e6061..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 935946d52792..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b5731a824060..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 8c6b19d52e3d..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 8e7abcf8f052..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb deleted file mode 100644 index 4979ccb81b0e..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/pubsub.rb +++ /dev/null @@ -1,1489 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PubSub - module V1 - # A policy constraining the storage of messages published to the topic. - # @!attribute [rw] allowed_persistence_regions - # @return [::Array<::String>] - # Optional. A list of IDs of Google Cloud regions where messages that are - # published to the topic may be persisted in storage. Messages published by - # publishers running in non-allowed Google Cloud regions (or running outside - # of Google Cloud altogether) are routed for storage in one of the allowed - # regions. An empty list means that no regions are allowed, and is not a - # valid configuration. - # @!attribute [rw] enforce_in_transit - # @return [::Boolean] - # Optional. If true, `allowed_persistence_regions` is also used to enforce - # in-transit guarantees for messages. That is, Pub/Sub will fail - # Publish operations on this topic and subscribe operations - # on any subscription attached to this topic in any region that is - # not in `allowed_persistence_regions`. - class MessageStoragePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for validating messages published against a schema. - # @!attribute [rw] schema - # @return [::String] - # Required. The name of the schema that messages published should be - # validated against. Format is `projects/{project}/schemas/{schema}`. The - # value of this field will be `_deleted-schema_` if the schema has been - # deleted. - # @!attribute [rw] encoding - # @return [::Google::Cloud::PubSub::V1::Encoding] - # Optional. The encoding of messages validated against `schema`. - # @!attribute [rw] first_revision_id - # @return [::String] - # Optional. The minimum (inclusive) revision allowed for validating messages. - # If empty or not present, allow any revision to be validated against - # last_revision or any revision created before. - # @!attribute [rw] last_revision_id - # @return [::String] - # Optional. The maximum (inclusive) revision allowed for validating messages. - # If empty or not present, allow any revision to be validated against - # first_revision or any revision created after. - class SchemaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for an ingestion data source on a topic. - # @!attribute [rw] aws_kinesis - # @return [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings::AwsKinesis] - # Optional. Amazon Kinesis Data Streams. - class IngestionDataSourceSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Ingestion settings for Amazon Kinesis Data Streams. - # @!attribute [r] state - # @return [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings::AwsKinesis::State] - # Output only. An output-only field that indicates the state of the Kinesis - # ingestion source. - # @!attribute [rw] stream_arn - # @return [::String] - # Required. The Kinesis stream ARN to ingest data from. - # @!attribute [rw] consumer_arn - # @return [::String] - # Required. The Kinesis consumer ARN to used for ingestion in Enhanced - # Fan-Out mode. The consumer must be already created and ready to be used. - # @!attribute [rw] aws_role_arn - # @return [::String] - # Required. AWS role ARN to be used for Federated Identity authentication - # with Kinesis. Check the Pub/Sub docs for how to set up this role and the - # required permissions that need to be attached to it. - # @!attribute [rw] gcp_service_account - # @return [::String] - # Required. The GCP service account to be used for Federated Identity - # authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for - # the provided role). The `aws_role_arn` must be set up with - # `accounts.google.com:sub` equals to this service account number. - class AwsKinesis - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states for ingestion from Amazon Kinesis Data Streams. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # Ingestion is active. - ACTIVE = 1 - - # Permission denied encountered while consuming data from Kinesis. - # This can happen if: - # - The provided `aws_role_arn` does not exist or does not have the - # appropriate permissions attached. - # - The provided `aws_role_arn` is not set up properly for Identity - # Federation using `gcp_service_account`. - # - The Pub/Sub SA is not granted the - # `iam.serviceAccounts.getOpenIdToken` permission on - # `gcp_service_account`. - KINESIS_PERMISSION_DENIED = 2 - - # Permission denied encountered while publishing to the topic. This can - # happen if the Pub/Sub SA has not been granted the [appropriate publish - # permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) - PUBLISH_PERMISSION_DENIED = 3 - - # The Kinesis stream does not exist. - STREAM_NOT_FOUND = 4 - - # The Kinesis consumer does not exist. - CONSUMER_NOT_FOUND = 5 - end - end - end - - # A topic resource. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the topic. It must have the format - # `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - # and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - # underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - # signs (`%`). It must be between 3 and 255 characters in length, and it - # must not start with `"goog"`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. See [Creating and managing labels] - # (https://cloud.google.com/pubsub/docs/labels). - # @!attribute [rw] message_storage_policy - # @return [::Google::Cloud::PubSub::V1::MessageStoragePolicy] - # Optional. Policy constraining the set of Google Cloud Platform regions - # where messages published to the topic may be stored. If not present, then - # no constraints are in effect. - # @!attribute [rw] kms_key_name - # @return [::String] - # Optional. The resource name of the Cloud KMS CryptoKey to be used to - # protect access to messages published on this topic. - # - # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - # @!attribute [rw] schema_settings - # @return [::Google::Cloud::PubSub::V1::SchemaSettings] - # Optional. Settings for validating messages published against a schema. - # @!attribute [rw] satisfies_pzs - # @return [::Boolean] - # Optional. Reserved for future use. This field is set only in responses from - # the server; it is ignored if it is set in any requests. - # @!attribute [rw] message_retention_duration - # @return [::Google::Protobuf::Duration] - # Optional. Indicates the minimum duration to retain a message after it is - # published to the topic. If this field is set, messages published to the - # topic in the last `message_retention_duration` are always available to - # subscribers. For instance, it allows any attached subscription to [seek to - # a - # timestamp](https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) - # that is up to `message_retention_duration` in the past. If this field is - # not set, message retention is controlled by settings on individual - # subscriptions. Cannot be more than 31 days or less than 10 minutes. - # @!attribute [r] state - # @return [::Google::Cloud::PubSub::V1::Topic::State] - # Output only. An output-only field indicating the state of the topic. - # @!attribute [rw] ingestion_data_source_settings - # @return [::Google::Cloud::PubSub::V1::IngestionDataSourceSettings] - # Optional. Settings for ingestion from a data source into this topic. - class Topic - 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 - - # The state of the topic. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # The topic does not have any persistent errors. - ACTIVE = 1 - - # Ingestion from the data source has encountered a permanent error. - # See the more detailed error state in the corresponding ingestion - # source configuration. - INGESTION_RESOURCE_ERROR = 2 - end - end - - # A message that is published by publishers and consumed by subscribers. The - # message must contain either a non-empty data field or at least one attribute. - # Note that client libraries represent this object differently - # depending on the language. See the corresponding [client library - # documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for - # more information. See [quotas and limits] - # (https://cloud.google.com/pubsub/quotas) for more information about message - # limits. - # @!attribute [rw] data - # @return [::String] - # Optional. The message data field. If this field is empty, the message must - # contain at least one attribute. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Attributes for this message. If this field is empty, the message - # must contain non-empty data. This can be used to filter messages on the - # subscription. - # @!attribute [rw] message_id - # @return [::String] - # ID of this message, assigned by the server when the message is published. - # Guaranteed to be unique within the topic. This value may be read by a - # subscriber that receives a `PubsubMessage` via a `Pull` call or a push - # delivery. It must not be populated by the publisher in a `Publish` call. - # @!attribute [rw] publish_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the message was published, populated by the server when - # it receives the `Publish` call. It must not be populated by the - # publisher in a `Publish` call. - # @!attribute [rw] ordering_key - # @return [::String] - # Optional. If non-empty, identifies related messages for which publish order - # should be respected. If a `Subscription` has `enable_message_ordering` set - # to `true`, messages published with the same non-empty `ordering_key` value - # will be delivered to subscribers in the order in which they are received by - # the Pub/Sub system. All `PubsubMessage`s published in a given - # `PublishRequest` must specify the same `ordering_key` value. For more - # information, see [ordering - # messages](https://cloud.google.com/pubsub/docs/ordering). - class PubsubMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for the GetTopic method. - # @!attribute [rw] topic - # @return [::String] - # Required. The name of the topic to get. - # Format is `projects/{project}/topics/{topic}`. - class GetTopicRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the UpdateTopic method. - # @!attribute [rw] topic - # @return [::Google::Cloud::PubSub::V1::Topic] - # Required. The updated topic object. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Indicates which fields in the provided topic to update. Must be - # specified and non-empty. Note that if `update_mask` contains - # "message_storage_policy" but the `message_storage_policy` is not set in - # the `topic` provided above, then the updated value is determined by the - # policy configured at the project or organization level. - class UpdateTopicRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the Publish method. - # @!attribute [rw] topic - # @return [::String] - # Required. The messages in the request will be published on this topic. - # Format is `projects/{project}/topics/{topic}`. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::PubSub::V1::PubsubMessage>] - # Required. The messages to publish. - class PublishRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `Publish` method. - # @!attribute [rw] message_ids - # @return [::Array<::String>] - # Optional. The server-assigned ID of each published message, in the same - # order as the messages in the request. IDs are guaranteed to be unique - # within the topic. - class PublishResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListTopics` method. - # @!attribute [rw] project - # @return [::String] - # Required. The name of the project in which to list topics. - # Format is `projects/{project-id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of topics to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The value returned by the last `ListTopicsResponse`; indicates - # that this is a continuation of a prior `ListTopics` call, and that the - # system should return the next page of data. - class ListTopicsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListTopics` method. - # @!attribute [rw] topics - # @return [::Array<::Google::Cloud::PubSub::V1::Topic>] - # Optional. The resulting topics. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. If not empty, indicates that there may be more topics that match - # the request; this value should be passed in a new `ListTopicsRequest`. - class ListTopicsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListTopicSubscriptions` method. - # @!attribute [rw] topic - # @return [::String] - # Required. The name of the topic that subscriptions are attached to. - # Format is `projects/{project}/topics/{topic}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of subscription names to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The value returned by the last `ListTopicSubscriptionsResponse`; - # indicates that this is a continuation of a prior `ListTopicSubscriptions` - # call, and that the system should return the next page of data. - class ListTopicSubscriptionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListTopicSubscriptions` method. - # @!attribute [rw] subscriptions - # @return [::Array<::String>] - # Optional. The names of subscriptions attached to the topic specified in the - # request. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. If not empty, indicates that there may be more subscriptions that - # match the request; this value should be passed in a new - # `ListTopicSubscriptionsRequest` to get more subscriptions. - class ListTopicSubscriptionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListTopicSnapshots` method. - # @!attribute [rw] topic - # @return [::String] - # Required. The name of the topic that snapshots are attached to. - # Format is `projects/{project}/topics/{topic}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of snapshot names to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The value returned by the last `ListTopicSnapshotsResponse`; - # indicates that this is a continuation of a prior `ListTopicSnapshots` call, - # and that the system should return the next page of data. - class ListTopicSnapshotsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListTopicSnapshots` method. - # @!attribute [rw] snapshots - # @return [::Array<::String>] - # Optional. The names of the snapshots that match the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. If not empty, indicates that there may be more snapshots that - # match the request; this value should be passed in a new - # `ListTopicSnapshotsRequest` to get more snapshots. - class ListTopicSnapshotsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `DeleteTopic` method. - # @!attribute [rw] topic - # @return [::String] - # Required. Name of the topic to delete. - # Format is `projects/{project}/topics/{topic}`. - class DeleteTopicRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the DetachSubscription method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription to detach. - # Format is `projects/{project}/subscriptions/{subscription}`. - class DetachSubscriptionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the DetachSubscription method. - # Reserved for future use. - class DetachSubscriptionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A subscription resource. If none of `push_config`, `bigquery_config`, or - # `cloud_storage_config` is set, then the subscriber will pull and ack messages - # using API methods. At most one of these fields may be set. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the subscription. It must have the format - # `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - # start with a letter, and contain only letters (`[A-Za-z]`), numbers - # (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - # plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - # in length, and it must not start with `"goog"`. - # @!attribute [rw] topic - # @return [::String] - # Required. The name of the topic from which this subscription is receiving - # messages. Format is `projects/{project}/topics/{topic}`. The value of this - # field will be `_deleted-topic_` if the topic has been deleted. - # @!attribute [rw] push_config - # @return [::Google::Cloud::PubSub::V1::PushConfig] - # Optional. If push delivery is used with this subscription, this field is - # used to configure it. - # @!attribute [rw] bigquery_config - # @return [::Google::Cloud::PubSub::V1::BigQueryConfig] - # Optional. If delivery to BigQuery is used with this subscription, this - # field is used to configure it. - # @!attribute [rw] cloud_storage_config - # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig] - # Optional. If delivery to Google Cloud Storage is used with this - # subscription, this field is used to configure it. - # @!attribute [rw] ack_deadline_seconds - # @return [::Integer] - # Optional. The approximate amount of time (on a best-effort basis) Pub/Sub - # waits for the subscriber to acknowledge receipt before resending the - # message. In the interval after the message is delivered and before it is - # acknowledged, it is considered to be _outstanding_. During that time - # period, the message will not be redelivered (on a best-effort basis). - # - # For pull subscriptions, this value is used as the initial value for the ack - # deadline. To override this value for a given message, call - # `ModifyAckDeadline` with the corresponding `ack_id` if using - # non-streaming pull or send the `ack_id` in a - # `StreamingModifyAckDeadlineRequest` if using streaming pull. - # The minimum custom deadline you can specify is 10 seconds. - # The maximum custom deadline you can specify is 600 seconds (10 minutes). - # If this parameter is 0, a default value of 10 seconds is used. - # - # For push delivery, this value is also used to set the request timeout for - # the call to the push endpoint. - # - # If the subscriber never acknowledges the message, the Pub/Sub - # system will eventually redeliver the message. - # @!attribute [rw] retain_acked_messages - # @return [::Boolean] - # Optional. Indicates whether to retain acknowledged messages. If true, then - # messages are not expunged from the subscription's backlog, even if they are - # acknowledged, until they fall out of the `message_retention_duration` - # window. This must be true if you would like to [`Seek` to a timestamp] - # (https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time) in - # the past to replay previously-acknowledged messages. - # @!attribute [rw] message_retention_duration - # @return [::Google::Protobuf::Duration] - # Optional. How long to retain unacknowledged messages in the subscription's - # backlog, from the moment a message is published. If `retain_acked_messages` - # is true, then this also configures the retention of acknowledged messages, - # and thus configures how far back in time a `Seek` can be done. Defaults to - # 7 days. Cannot be more than 31 days or less than 10 minutes. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. See [Creating and managing - # labels](https://cloud.google.com/pubsub/docs/labels). - # @!attribute [rw] enable_message_ordering - # @return [::Boolean] - # Optional. If true, messages published with the same `ordering_key` in - # `PubsubMessage` will be delivered to the subscribers in the order in which - # they are received by the Pub/Sub system. Otherwise, they may be delivered - # in any order. - # @!attribute [rw] expiration_policy - # @return [::Google::Cloud::PubSub::V1::ExpirationPolicy] - # Optional. A policy that specifies the conditions for this subscription's - # expiration. A subscription is considered active as long as any connected - # subscriber is successfully consuming messages from the subscription or is - # issuing operations on the subscription. If `expiration_policy` is not set, - # a *default policy* with `ttl` of 31 days will be used. The minimum allowed - # value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set, - # but `expiration_policy.ttl` is not set, the subscription never expires. - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression written in the Pub/Sub [filter - # language](https://cloud.google.com/pubsub/docs/filtering). If non-empty, - # then only `PubsubMessage`s whose `attributes` field matches the filter are - # delivered on this subscription. If empty, then no messages are filtered - # out. - # @!attribute [rw] dead_letter_policy - # @return [::Google::Cloud::PubSub::V1::DeadLetterPolicy] - # Optional. A policy that specifies the conditions for dead lettering - # messages in this subscription. If dead_letter_policy is not set, dead - # lettering is disabled. - # - # The Pub/Sub service account associated with this subscriptions's - # parent project (i.e., - # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - # permission to Acknowledge() messages on this subscription. - # @!attribute [rw] retry_policy - # @return [::Google::Cloud::PubSub::V1::RetryPolicy] - # Optional. A policy that specifies how Pub/Sub retries message delivery for - # this subscription. - # - # If not set, the default retry policy is applied. This generally implies - # that messages will be retried as soon as possible for healthy subscribers. - # RetryPolicy will be triggered on NACKs or acknowledgement deadline - # exceeded events for a given message. - # @!attribute [rw] detached - # @return [::Boolean] - # Optional. Indicates whether the subscription is detached from its topic. - # Detached subscriptions don't receive messages from their topic and don't - # retain any backlog. `Pull` and `StreamingPull` requests will return - # FAILED_PRECONDITION. If the subscription is a push subscription, pushes to - # the endpoint will not be made. - # @!attribute [rw] enable_exactly_once_delivery - # @return [::Boolean] - # Optional. If true, Pub/Sub provides the following guarantees for the - # delivery of a message with a given value of `message_id` on this - # subscription: - # - # * The message sent to a subscriber is guaranteed not to be resent - # before the message's acknowledgement deadline expires. - # * An acknowledged message will not be resent to a subscriber. - # - # Note that subscribers may still receive multiple copies of a message - # when `enable_exactly_once_delivery` is true if the message was published - # multiple times by a publisher client. These copies are considered distinct - # by Pub/Sub and have distinct `message_id` values. - # @!attribute [r] topic_message_retention_duration - # @return [::Google::Protobuf::Duration] - # Output only. Indicates the minimum duration for which a message is retained - # after it is published to the subscription's topic. If this field is set, - # messages published to the subscription's topic in the last - # `topic_message_retention_duration` are always available to subscribers. See - # the `message_retention_duration` field in `Topic`. This field is set only - # in responses from the server; it is ignored if it is set in any requests. - # @!attribute [r] state - # @return [::Google::Cloud::PubSub::V1::Subscription::State] - # Output only. An output-only field indicating whether or not the - # subscription can receive messages. - class Subscription - 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 for a subscription. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # The subscription can actively receive messages - ACTIVE = 1 - - # The subscription cannot receive messages because of an error with the - # resource to which it pushes messages. See the more detailed error state - # in the corresponding configuration. - RESOURCE_ERROR = 2 - end - end - - # A policy that specifies how Pub/Sub retries message delivery. - # - # Retry delay will be exponential based on provided minimum and maximum - # backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. - # - # RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded - # events for a given message. - # - # Retry Policy is implemented on a best effort basis. At times, the delay - # between consecutive deliveries may not match the configuration. That is, - # delay can be more or less than configured backoff. - # @!attribute [rw] minimum_backoff - # @return [::Google::Protobuf::Duration] - # Optional. The minimum delay between consecutive deliveries of a given - # message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. - # @!attribute [rw] maximum_backoff - # @return [::Google::Protobuf::Duration] - # Optional. The maximum delay between consecutive deliveries of a given - # message. Value should be between 0 and 600 seconds. Defaults to 600 - # seconds. - class RetryPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dead lettering is done on a best effort basis. The same message might be - # dead lettered multiple times. - # - # If validation on any of the fields fails at subscription creation/updation, - # the create/update subscription request will fail. - # @!attribute [rw] dead_letter_topic - # @return [::String] - # Optional. The name of the topic to which dead letter messages should be - # published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub - # service account associated with the enclosing subscription's parent project - # (i.e., service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - # have permission to Publish() to this topic. - # - # The operation will fail if the topic does not exist. - # Users should ensure that there is a subscription attached to this topic - # since messages published to a topic with no subscriptions are lost. - # @!attribute [rw] max_delivery_attempts - # @return [::Integer] - # Optional. The maximum number of delivery attempts for any message. The - # value must be between 5 and 100. - # - # The number of delivery attempts is defined as 1 + (the sum of number of - # NACKs and number of times the acknowledgement deadline has been exceeded - # for the message). - # - # A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - # client libraries may automatically extend ack_deadlines. - # - # This field will be honored on a best effort basis. - # - # If this parameter is 0, a default value of 5 is used. - class DeadLetterPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A policy that specifies the conditions for resource expiration (i.e., - # automatic resource deletion). - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Optional. Specifies the "time-to-live" duration for an associated resource. - # The resource expires if it is not active for a period of `ttl`. The - # definition of "activity" depends on the type of the associated resource. - # The minimum and maximum allowed values for `ttl` depend on the type of the - # associated resource, as well. If `ttl` is not set, the associated resource - # never expires. - class ExpirationPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a push delivery endpoint. - # @!attribute [rw] push_endpoint - # @return [::String] - # Optional. A URL locating the endpoint to which messages should be pushed. - # For example, a Webhook endpoint might use `https://example.com/push`. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Endpoint configuration attributes that can be used to control - # different aspects of the message delivery. - # - # The only currently supported attribute is `x-goog-version`, which you can - # use to change the format of the pushed message. This attribute - # indicates the version of the data expected by the endpoint. This - # controls the shape of the pushed message (i.e., its fields and metadata). - # - # If not present during the `CreateSubscription` call, it will default to - # the version of the Pub/Sub API used to make such call. If not present in a - # `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - # calls will always return a valid version, even if the subscription was - # created without this attribute. - # - # The only supported values for the `x-goog-version` attribute are: - # - # * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - # * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - # - # For example: - # `attributes { "x-goog-version": "v1" }` - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::PubSub::V1::PushConfig::OidcToken] - # Optional. If specified, Pub/Sub will generate and attach an OIDC JWT - # token as an `Authorization` header in the HTTP request for every pushed - # message. - # @!attribute [rw] pubsub_wrapper - # @return [::Google::Cloud::PubSub::V1::PushConfig::PubsubWrapper] - # Optional. When set, the payload to the push endpoint is in the form of - # the JSON representation of a PubsubMessage - # (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - # @!attribute [rw] no_wrapper - # @return [::Google::Cloud::PubSub::V1::PushConfig::NoWrapper] - # Optional. When set, the payload to the push endpoint is not wrapped. - class PushConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # @!attribute [rw] service_account_email - # @return [::String] - # Optional. [Service account - # email](https://cloud.google.com/iam/docs/service-accounts) - # used for generating the OIDC token. For more information - # on setting up authentication, see - # [Push subscriptions](https://cloud.google.com/pubsub/docs/push). - # @!attribute [rw] audience - # @return [::String] - # Optional. Audience to be used when generating OIDC token. The audience - # claim identifies the recipients that the JWT is intended for. The - # audience value is a single case-sensitive string. Having multiple values - # (array) for the audience field is not supported. More info about the OIDC - # JWT token audience here: - # https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, - # the Push endpoint URL will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The payload to the push endpoint is in the form of the JSON representation - # of a PubsubMessage - # (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage). - class PubsubWrapper - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Sets the `data` field as the HTTP body for delivery. - # @!attribute [rw] write_metadata - # @return [::Boolean] - # Optional. When true, writes the Pub/Sub message metadata to - # `x-goog-pubsub-:` headers of the HTTP request. Writes the - # Pub/Sub message attributes to `:` headers of the HTTP request. - class NoWrapper - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Configuration for a BigQuery subscription. - # @!attribute [rw] table - # @return [::String] - # Optional. The name of the table to which to write data, of the form - # \\{projectId}.\\{datasetId}.\\{tableId} - # @!attribute [rw] use_topic_schema - # @return [::Boolean] - # Optional. When true, use the topic's schema as the columns to write to in - # BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be - # enabled at the same time. - # @!attribute [rw] write_metadata - # @return [::Boolean] - # Optional. When true, write the subscription name, message_id, publish_time, - # attributes, and ordering_key to additional columns in the table. The - # subscription name, message_id, and publish_time fields are put in their own - # columns while all other message properties (other than data) are written to - # a JSON object in the attributes column. - # @!attribute [rw] drop_unknown_fields - # @return [::Boolean] - # Optional. When true and use_topic_schema is true, any fields that are a - # part of the topic schema that are not part of the BigQuery table schema are - # dropped when writing to BigQuery. Otherwise, the schemas must be kept in - # sync and any messages with extra fields are not written and remain in the - # subscription's backlog. - # @!attribute [r] state - # @return [::Google::Cloud::PubSub::V1::BigQueryConfig::State] - # Output only. An output-only field that indicates whether or not the - # subscription can receive messages. - # @!attribute [rw] use_table_schema - # @return [::Boolean] - # Optional. When true, use the BigQuery table's schema as the columns to - # write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be - # enabled at the same time. - # @!attribute [rw] service_account_email - # @return [::String] - # Optional. The service account to use to write to BigQuery. The subscription - # creator or updater that specifies this field must have - # `iam.serviceAccounts.actAs` permission on the service account. If not - # specified, the Pub/Sub [service - # agent](https://cloud.google.com/iam/docs/service-agents), - # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - class BigQueryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states for a BigQuery subscription. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # The subscription can actively send messages to BigQuery - ACTIVE = 1 - - # Cannot write to the BigQuery table because of permission denied errors. - # This can happen if - # - Pub/Sub SA has not been granted the [appropriate BigQuery IAM - # permissions](https://cloud.google.com/pubsub/docs/create-subscription#assign_bigquery_service_account) - # - bigquery.googleapis.com API is not enabled for the project - # ([instructions](https://cloud.google.com/service-usage/docs/enable-disable)) - PERMISSION_DENIED = 2 - - # Cannot write to the BigQuery table because it does not exist. - NOT_FOUND = 3 - - # Cannot write to the BigQuery table due to a schema mismatch. - SCHEMA_MISMATCH = 4 - - # Cannot write to the destination because enforce_in_transit is set to true - # and the destination locations are not in the allowed regions. - IN_TRANSIT_LOCATION_RESTRICTION = 5 - end - end - - # Configuration for a Cloud Storage subscription. - # @!attribute [rw] bucket - # @return [::String] - # Required. User-provided name for the Cloud Storage bucket. - # The bucket must be created by the user. The bucket name must be without - # any prefix like "gs://". See the [bucket naming - # requirements] (https://cloud.google.com/storage/docs/buckets#naming). - # @!attribute [rw] filename_prefix - # @return [::String] - # Optional. User-provided prefix for Cloud Storage filename. See the [object - # naming requirements](https://cloud.google.com/storage/docs/objects#naming). - # @!attribute [rw] filename_suffix - # @return [::String] - # Optional. User-provided suffix for Cloud Storage filename. See the [object - # naming requirements](https://cloud.google.com/storage/docs/objects#naming). - # Must not end in "/". - # @!attribute [rw] filename_datetime_format - # @return [::String] - # Optional. User-provided format string specifying how to represent datetimes - # in Cloud Storage filenames. See the [datetime format - # guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names). - # @!attribute [rw] text_config - # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig::TextConfig] - # Optional. If set, message data will be written to Cloud Storage in text - # format. - # @!attribute [rw] avro_config - # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig::AvroConfig] - # Optional. If set, message data will be written to Cloud Storage in Avro - # format. - # @!attribute [rw] max_duration - # @return [::Google::Protobuf::Duration] - # Optional. The maximum duration that can elapse before a new Cloud Storage - # file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not - # exceed the subscription's acknowledgement deadline. - # @!attribute [rw] max_bytes - # @return [::Integer] - # Optional. The maximum bytes that can be written to a Cloud Storage file - # before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may - # be exceeded in cases where messages are larger than the limit. - # @!attribute [rw] max_messages - # @return [::Integer] - # Optional. The maximum number of messages that can be written to a Cloud - # Storage file before a new file is created. Min 1000 messages. - # @!attribute [r] state - # @return [::Google::Cloud::PubSub::V1::CloudStorageConfig::State] - # Output only. An output-only field that indicates whether or not the - # subscription can receive messages. - # @!attribute [rw] service_account_email - # @return [::String] - # Optional. The service account to use to write to Cloud Storage. The - # subscription creator or updater that specifies this field must have - # `iam.serviceAccounts.actAs` permission on the service account. If not - # specified, the Pub/Sub - # [service agent](https://cloud.google.com/iam/docs/service-agents), - # service-\\{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used. - class CloudStorageConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for writing message data in text format. - # Message payloads will be written to files as raw text, separated by a - # newline. - class TextConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for writing message data in Avro format. - # Message payloads and metadata will be written to files as an Avro binary. - # @!attribute [rw] write_metadata - # @return [::Boolean] - # Optional. When true, write the subscription name, message_id, - # publish_time, attributes, and ordering_key as additional fields in the - # output. The subscription name, message_id, and publish_time fields are - # put in their own fields while all other message properties other than - # data (for example, an ordering_key, if present) are added as entries in - # the attributes map. - # @!attribute [rw] use_topic_schema - # @return [::Boolean] - # Optional. When true, the output Cloud Storage file will be serialized - # using the topic schema, if it exists. - class AvroConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible states for a Cloud Storage subscription. - module State - # Default value. This value is unused. - STATE_UNSPECIFIED = 0 - - # The subscription can actively send messages to Cloud Storage. - ACTIVE = 1 - - # Cannot write to the Cloud Storage bucket because of permission denied - # errors. - PERMISSION_DENIED = 2 - - # Cannot write to the Cloud Storage bucket because it does not exist. - NOT_FOUND = 3 - - # Cannot write to the destination because enforce_in_transit is set to true - # and the destination locations are not in the allowed regions. - IN_TRANSIT_LOCATION_RESTRICTION = 4 - - # Cannot write to the Cloud Storage bucket due to an incompatibility - # between the topic schema and subscription settings. - SCHEMA_MISMATCH = 5 - end - end - - # A message and its corresponding acknowledgment ID. - # @!attribute [rw] ack_id - # @return [::String] - # Optional. This ID can be used to acknowledge the received message. - # @!attribute [rw] message - # @return [::Google::Cloud::PubSub::V1::PubsubMessage] - # Optional. The message. - # @!attribute [rw] delivery_attempt - # @return [::Integer] - # Optional. The approximate number of times that Pub/Sub has attempted to - # deliver the associated message to a subscriber. - # - # More precisely, this is 1 + (number of NACKs) + - # (number of ack_deadline exceeds) for this message. - # - # A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - # exceeds event is whenever a message is not acknowledged within - # ack_deadline. Note that ack_deadline is initially - # Subscription.ackDeadlineSeconds, but may get extended automatically by - # the client library. - # - # Upon the first delivery of a given message, `delivery_attempt` will have a - # value of 1. The value is calculated at best effort and is approximate. - # - # If a DeadLetterPolicy is not set on the subscription, this will be 0. - class ReceivedMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the GetSubscription method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The name of the subscription to get. - # Format is `projects/{project}/subscriptions/{sub}`. - class GetSubscriptionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the UpdateSubscription method. - # @!attribute [rw] subscription - # @return [::Google::Cloud::PubSub::V1::Subscription] - # Required. The updated subscription object. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Indicates which fields in the provided subscription to update. - # Must be specified and non-empty. - class UpdateSubscriptionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListSubscriptions` method. - # @!attribute [rw] project - # @return [::String] - # Required. The name of the project in which to list subscriptions. - # Format is `projects/{project-id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of subscriptions to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The value returned by the last `ListSubscriptionsResponse`; - # indicates that this is a continuation of a prior `ListSubscriptions` call, - # and that the system should return the next page of data. - class ListSubscriptionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListSubscriptions` method. - # @!attribute [rw] subscriptions - # @return [::Array<::Google::Cloud::PubSub::V1::Subscription>] - # Optional. The subscriptions that match the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. If not empty, indicates that there may be more subscriptions that - # match the request; this value should be passed in a new - # `ListSubscriptionsRequest` to get more subscriptions. - class ListSubscriptionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the DeleteSubscription method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription to delete. - # Format is `projects/{project}/subscriptions/{sub}`. - class DeleteSubscriptionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the ModifyPushConfig method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The name of the subscription. - # Format is `projects/{project}/subscriptions/{sub}`. - # @!attribute [rw] push_config - # @return [::Google::Cloud::PubSub::V1::PushConfig] - # Required. The push configuration for future deliveries. - # - # An empty `pushConfig` indicates that the Pub/Sub system should - # stop pushing messages from the given subscription and allow - # messages to be pulled and acknowledged - effectively pausing - # the subscription if `Pull` or `StreamingPull` is not called. - class ModifyPushConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `Pull` method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription from which messages should be pulled. - # Format is `projects/{project}/subscriptions/{sub}`. - # @!attribute [rw] return_immediately - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. If this field set to true, the system will respond immediately - # even if it there are no messages available to return in the `Pull` - # response. Otherwise, the system may wait (for a bounded amount of time) - # until at least one message is available, rather than returning no messages. - # Warning: setting this field to `true` is discouraged because it adversely - # impacts the performance of `Pull` operations. We recommend that users do - # not set this field. - # @!attribute [rw] max_messages - # @return [::Integer] - # Required. The maximum number of messages to return for this request. Must - # be a positive integer. The Pub/Sub system may return fewer than the number - # specified. - class PullRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `Pull` method. - # @!attribute [rw] received_messages - # @return [::Array<::Google::Cloud::PubSub::V1::ReceivedMessage>] - # Optional. Received Pub/Sub messages. The list will be empty if there are no - # more messages available in the backlog, or if no messages could be returned - # before the request timeout. For JSON, the response can be entirely - # empty. The Pub/Sub system may return fewer than the `maxMessages` requested - # even if there are more messages available in the backlog. - class PullResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the ModifyAckDeadline method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The name of the subscription. - # Format is `projects/{project}/subscriptions/{sub}`. - # @!attribute [rw] ack_ids - # @return [::Array<::String>] - # Required. List of acknowledgment IDs. - # @!attribute [rw] ack_deadline_seconds - # @return [::Integer] - # Required. The new ack deadline with respect to the time this request was - # sent to the Pub/Sub system. For example, if the value is 10, the new ack - # deadline will expire 10 seconds after the `ModifyAckDeadline` call was - # made. Specifying zero might immediately make the message available for - # delivery to another subscriber client. This typically results in an - # increase in the rate of message redeliveries (that is, duplicates). - # The minimum deadline you can specify is 0 seconds. - # The maximum deadline you can specify in a single request is 600 seconds - # (10 minutes). - class ModifyAckDeadlineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the Acknowledge method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription whose message is being acknowledged. - # Format is `projects/{project}/subscriptions/{sub}`. - # @!attribute [rw] ack_ids - # @return [::Array<::String>] - # Required. The acknowledgment ID for the messages being acknowledged that - # was returned by the Pub/Sub system in the `Pull` response. Must not be - # empty. - class AcknowledgeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `StreamingPull` streaming RPC method. This request is used to - # establish the initial stream as well as to stream acknowledgements and ack - # deadline modifications from the client to the server. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription for which to initialize the new stream. This - # must be provided in the first request on the stream, and must not be set in - # subsequent requests from client to server. - # Format is `projects/{project}/subscriptions/{sub}`. - # @!attribute [rw] ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs for acknowledging previously received - # messages (received on this stream or a different stream). If an ack ID has - # expired, the corresponding message may be redelivered later. Acknowledging - # a message more than once will not result in an error. If the - # acknowledgement ID is malformed, the stream will be aborted with status - # `INVALID_ARGUMENT`. - # @!attribute [rw] modify_deadline_seconds - # @return [::Array<::Integer>] - # Optional. The list of new ack deadlines for the IDs listed in - # `modify_deadline_ack_ids`. The size of this list must be the same as the - # size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - # with `INVALID_ARGUMENT`. Each element in this list is applied to the - # element in the same position in `modify_deadline_ack_ids`. The new ack - # deadline is with respect to the time this request was sent to the Pub/Sub - # system. Must be >= 0. For example, if the value is 10, the new ack deadline - # will expire 10 seconds after this request is received. If the value is 0, - # the message is immediately made available for another streaming or - # non-streaming pull request. If the value is < 0 (an error), the stream will - # be aborted with status `INVALID_ARGUMENT`. - # @!attribute [rw] modify_deadline_ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs whose deadline will be modified based - # on the corresponding element in `modify_deadline_seconds`. This field can - # be used to indicate that more time is needed to process a message by the - # subscriber, or to make the message available for redelivery if the - # processing was interrupted. - # @!attribute [rw] stream_ack_deadline_seconds - # @return [::Integer] - # Required. The ack deadline to use for the stream. This must be provided in - # the first request on the stream, but it can also be updated on subsequent - # requests from client to server. The minimum deadline you can specify is 10 - # seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - # @!attribute [rw] client_id - # @return [::String] - # Optional. A unique identifier that is used to distinguish client instances - # from each other. Only needs to be provided on the initial request. When a - # stream disconnects and reconnects for the same stream, the client_id should - # be set to the same value so that state associated with the old stream can - # be transferred to the new stream. The same client_id should not be used for - # different client instances. - # @!attribute [rw] max_outstanding_messages - # @return [::Integer] - # Optional. Flow control settings for the maximum number of outstanding - # messages. When there are `max_outstanding_messages` currently sent to the - # streaming pull client that have not yet been acked or nacked, the server - # stops sending more messages. The sending of messages resumes once the - # number of outstanding messages is less than this value. If the value is - # <= 0, there is no limit to the number of outstanding messages. This - # property can only be set on the initial StreamingPullRequest. If it is set - # on a subsequent request, the stream will be aborted with status - # `INVALID_ARGUMENT`. - # @!attribute [rw] max_outstanding_bytes - # @return [::Integer] - # Optional. Flow control settings for the maximum number of outstanding - # bytes. When there are `max_outstanding_bytes` or more worth of messages - # currently sent to the streaming pull client that have not yet been acked or - # nacked, the server will stop sending more messages. The sending of messages - # resumes once the number of outstanding bytes is less than this value. If - # the value is <= 0, there is no limit to the number of outstanding bytes. - # This property can only be set on the initial StreamingPullRequest. If it is - # set on a subsequent request, the stream will be aborted with status - # `INVALID_ARGUMENT`. - class StreamingPullRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `StreamingPull` method. This response is used to stream - # messages from the server to the client. - # @!attribute [rw] received_messages - # @return [::Array<::Google::Cloud::PubSub::V1::ReceivedMessage>] - # Optional. Received Pub/Sub messages. This will not be empty. - # @!attribute [rw] acknowledge_confirmation - # @return [::Google::Cloud::PubSub::V1::StreamingPullResponse::AcknowledgeConfirmation] - # Optional. This field will only be set if `enable_exactly_once_delivery` is - # set to `true`. - # @!attribute [rw] modify_ack_deadline_confirmation - # @return [::Google::Cloud::PubSub::V1::StreamingPullResponse::ModifyAckDeadlineConfirmation] - # Optional. This field will only be set if `enable_exactly_once_delivery` is - # set to `true`. - # @!attribute [rw] subscription_properties - # @return [::Google::Cloud::PubSub::V1::StreamingPullResponse::SubscriptionProperties] - # Optional. Properties associated with this subscription. - class StreamingPullResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Acknowledgement IDs sent in one or more previous requests to acknowledge a - # previously received message. - # @!attribute [rw] ack_ids - # @return [::Array<::String>] - # Optional. Successfully processed acknowledgement IDs. - # @!attribute [rw] invalid_ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs that were malformed or whose - # acknowledgement deadline has expired. - # @!attribute [rw] unordered_ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs that were out of order. - # @!attribute [rw] temporary_failed_ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs that failed processing with - # temporary issues. - class AcknowledgeConfirmation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Acknowledgement IDs sent in one or more previous requests to modify the - # deadline for a specific message. - # @!attribute [rw] ack_ids - # @return [::Array<::String>] - # Optional. Successfully processed acknowledgement IDs. - # @!attribute [rw] invalid_ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs that were malformed or whose - # acknowledgement deadline has expired. - # @!attribute [rw] temporary_failed_ack_ids - # @return [::Array<::String>] - # Optional. List of acknowledgement IDs that failed processing with - # temporary issues. - class ModifyAckDeadlineConfirmation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Subscription properties sent as part of the response. - # @!attribute [rw] exactly_once_delivery_enabled - # @return [::Boolean] - # Optional. True iff exactly once delivery is enabled for this - # subscription. - # @!attribute [rw] message_ordering_enabled - # @return [::Boolean] - # Optional. True iff message ordering is enabled for this subscription. - class SubscriptionProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request for the `CreateSnapshot` method. - # @!attribute [rw] name - # @return [::String] - # Required. User-provided name for this snapshot. If the name is not provided - # in the request, the server will assign a random name for this snapshot on - # the same project as the subscription. Note that for REST API requests, you - # must specify a name. See the [resource name - # rules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - # Format is `projects/{project}/snapshots/{snap}`. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription whose backlog the snapshot retains. - # Specifically, the created snapshot is guaranteed to retain: - # (a) The existing backlog on the subscription. More precisely, this is - # defined as the messages in the subscription's backlog that are - # unacknowledged upon the successful completion of the - # `CreateSnapshot` request; as well as: - # (b) Any messages published to the subscription's topic following the - # successful completion of the CreateSnapshot request. - # Format is `projects/{project}/subscriptions/{sub}`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. See [Creating and managing - # labels](https://cloud.google.com/pubsub/docs/labels). - class CreateSnapshotRequest - 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 - - # Request for the UpdateSnapshot method. - # @!attribute [rw] snapshot - # @return [::Google::Cloud::PubSub::V1::Snapshot] - # Required. The updated snapshot object. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Indicates which fields in the provided snapshot to update. - # Must be specified and non-empty. - class UpdateSnapshotRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A snapshot resource. Snapshots are used in - # [Seek](https://cloud.google.com/pubsub/docs/replay-overview) - # operations, which allow you to manage message acknowledgments in bulk. That - # is, you can set the acknowledgment state of messages in an existing - # subscription to the state captured by a snapshot. - # @!attribute [rw] name - # @return [::String] - # Optional. The name of the snapshot. - # @!attribute [rw] topic - # @return [::String] - # Optional. The name of the topic from which this snapshot is retaining - # messages. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The snapshot is guaranteed to exist up until this time. - # A newly-created snapshot expires no later than 7 days from the time of its - # creation. Its exact lifetime is determined at creation by the existing - # backlog in the source subscription. Specifically, the lifetime of the - # snapshot is `7 days - (age of oldest unacked message in the subscription)`. - # For example, consider a subscription whose oldest unacked message is 3 days - # old. If a snapshot is created from this subscription, the snapshot -- which - # will always capture this 3-day-old backlog as long as the snapshot - # exists -- will expire in 4 days. The service will refuse to create a - # snapshot that would expire in less than 1 hour after creation. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. See [Creating and managing labels] - # (https://cloud.google.com/pubsub/docs/labels). - class Snapshot - 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 - - # Request for the GetSnapshot method. - # @!attribute [rw] snapshot - # @return [::String] - # Required. The name of the snapshot to get. - # Format is `projects/{project}/snapshots/{snap}`. - class GetSnapshotRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListSnapshots` method. - # @!attribute [rw] project - # @return [::String] - # Required. The name of the project in which to list snapshots. - # Format is `projects/{project-id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of snapshots to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The value returned by the last `ListSnapshotsResponse`; indicates - # that this is a continuation of a prior `ListSnapshots` call, and that the - # system should return the next page of data. - class ListSnapshotsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListSnapshots` method. - # @!attribute [rw] snapshots - # @return [::Array<::Google::Cloud::PubSub::V1::Snapshot>] - # Optional. The resulting snapshots. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. If not empty, indicates that there may be more snapshot that - # match the request; this value should be passed in a new - # `ListSnapshotsRequest`. - class ListSnapshotsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `DeleteSnapshot` method. - # @!attribute [rw] snapshot - # @return [::String] - # Required. The name of the snapshot to delete. - # Format is `projects/{project}/snapshots/{snap}`. - class DeleteSnapshotRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `Seek` method. - # @!attribute [rw] subscription - # @return [::String] - # Required. The subscription to affect. - # @!attribute [rw] time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time to seek to. - # Messages retained in the subscription that were published before this - # time are marked as acknowledged, and messages retained in the - # subscription that were published after this time are marked as - # unacknowledged. Note that this operation affects only those messages - # retained in the subscription (configured by the combination of - # `message_retention_duration` and `retain_acked_messages`). For example, - # if `time` corresponds to a point before the message retention - # window (or to a point before the system's notion of the subscription - # creation time), only retained messages will be marked as unacknowledged, - # and already-expunged messages will not be restored. - # @!attribute [rw] snapshot - # @return [::String] - # Optional. The snapshot to seek to. The snapshot's topic must be the same - # as that of the provided subscription. Format is - # `projects/{project}/snapshots/{snap}`. - class SeekRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `Seek` method (this response is empty). - class SeekResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb deleted file mode 100644 index 11917ee55a99..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/pubsub/v1/schema.rb +++ /dev/null @@ -1,303 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module PubSub - module V1 - # A schema resource. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the schema. - # Format is `projects/{project}/schemas/{schema}`. - # @!attribute [rw] type - # @return [::Google::Cloud::PubSub::V1::Schema::Type] - # The type of the schema definition. - # @!attribute [rw] definition - # @return [::String] - # The definition of the schema. This should contain a string representing - # the full definition of the schema that is a valid schema definition of - # the type specified in `type`. - # @!attribute [r] revision_id - # @return [::String] - # Output only. Immutable. The revision ID of the schema. - # @!attribute [r] revision_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp that the revision was created. - class Schema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible schema definition types. - module Type - # Default value. This value is unused. - TYPE_UNSPECIFIED = 0 - - # A Protocol Buffer schema definition. - PROTOCOL_BUFFER = 1 - - # An Avro schema definition. - AVRO = 2 - end - end - - # Request for the CreateSchema method. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to create the schema. - # Format is `projects/{project-id}`. - # @!attribute [rw] schema - # @return [::Google::Cloud::PubSub::V1::Schema] - # Required. The schema object to create. - # - # This schema's `name` parameter is ignored. The schema object returned - # by CreateSchema will have a `name` made using the given `parent` and - # `schema_id`. - # @!attribute [rw] schema_id - # @return [::String] - # The ID to use for the schema, which will become the final component of - # the schema's resource name. - # - # See https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names for - # resource name constraints. - class CreateSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the GetSchema method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the schema to get. - # Format is `projects/{project}/schemas/{schema}`. - # @!attribute [rw] view - # @return [::Google::Cloud::PubSub::V1::SchemaView] - # The set of fields to return in the response. If not set, returns a Schema - # with all fields filled out. Set to `BASIC` to omit the `definition`. - class GetSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListSchemas` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to list schemas. - # Format is `projects/{project-id}`. - # @!attribute [rw] view - # @return [::Google::Cloud::PubSub::V1::SchemaView] - # The set of Schema fields to return in the response. If not set, returns - # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - # retrieve all fields. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of schemas to return. - # @!attribute [rw] page_token - # @return [::String] - # The value returned by the last `ListSchemasResponse`; indicates that - # this is a continuation of a prior `ListSchemas` call, and that the - # system should return the next page of data. - class ListSchemasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListSchemas` method. - # @!attribute [rw] schemas - # @return [::Array<::Google::Cloud::PubSub::V1::Schema>] - # The resulting schemas. - # @!attribute [rw] next_page_token - # @return [::String] - # If not empty, indicates that there may be more schemas that match the - # request; this value should be passed in a new `ListSchemasRequest`. - class ListSchemasResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListSchemaRevisions` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the schema to list revisions for. - # @!attribute [rw] view - # @return [::Google::Cloud::PubSub::V1::SchemaView] - # The set of Schema fields to return in the response. If not set, returns - # Schemas with `name` and `type`, but not `definition`. Set to `FULL` to - # retrieve all fields. - # @!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 ListSchemaRevisions call. - # Provide this to retrieve the subsequent page. - class ListSchemaRevisionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListSchemaRevisions` method. - # @!attribute [rw] schemas - # @return [::Array<::Google::Cloud::PubSub::V1::Schema>] - # The revisions of the schema. - # @!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 empty, there are no subsequent pages. - class ListSchemaRevisionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for CommitSchema method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the schema we are revising. - # Format is `projects/{project}/schemas/{schema}`. - # @!attribute [rw] schema - # @return [::Google::Cloud::PubSub::V1::Schema] - # Required. The schema revision to commit. - class CommitSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `RollbackSchema` method. - # @!attribute [rw] name - # @return [::String] - # Required. The schema being rolled back with revision id. - # @!attribute [rw] revision_id - # @return [::String] - # Required. The revision ID to roll back to. - # It must be a revision of the same schema. - # - # Example: c7cfa2a8 - class RollbackSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `DeleteSchemaRevision` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the schema revision to be deleted, with a revision ID - # explicitly included. - # - # Example: `projects/123/schemas/my-schema@c7cfa2a8` - # @!attribute [rw] revision_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. This field is deprecated and should not be used for specifying - # the revision ID. The revision ID should be specified via the `name` - # parameter. - class DeleteSchemaRevisionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `DeleteSchema` method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the schema to delete. - # Format is `projects/{project}/schemas/{schema}`. - class DeleteSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ValidateSchema` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to validate schemas. - # Format is `projects/{project-id}`. - # @!attribute [rw] schema - # @return [::Google::Cloud::PubSub::V1::Schema] - # Required. The schema object to validate. - class ValidateSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ValidateSchema` method. - # Empty for now. - class ValidateSchemaResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ValidateMessage` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project in which to validate schemas. - # Format is `projects/{project-id}`. - # @!attribute [rw] name - # @return [::String] - # Name of the schema against which to validate. - # - # Format is `projects/{project}/schemas/{schema}`. - # @!attribute [rw] schema - # @return [::Google::Cloud::PubSub::V1::Schema] - # Ad-hoc schema against which to validate - # @!attribute [rw] message - # @return [::String] - # Message to validate against the provided `schema_spec`. - # @!attribute [rw] encoding - # @return [::Google::Cloud::PubSub::V1::Encoding] - # The encoding expected for messages - class ValidateMessageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ValidateMessage` method. - # Empty for now. - class ValidateMessageResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # View of Schema object fields to be returned by GetSchema and ListSchemas. - module SchemaView - # The default / unset value. - # The API will default to the BASIC view. - SCHEMA_VIEW_UNSPECIFIED = 0 - - # Include the name and type of the schema, but not the definition. - BASIC = 1 - - # Include all Schema object fields. - FULL = 2 - end - - # Possible encoding types for messages. - module Encoding - # Unspecified - ENCODING_UNSPECIFIED = 0 - - # JSON encoding - JSON = 1 - - # Binary encoding, as defined by the schema type. For some schema types, - # binary encoding may not be available. - BINARY = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 41c8c3a565cc..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-pubsub-v1/snippets/Gemfile deleted file mode 100644 index 7ab8afb44fd0..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-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-pubsub-v1", path: "../" -else - gem "google-cloud-pubsub-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-pubsub-v1/snippets/publisher/create_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb deleted file mode 100644 index 8811984e8f2c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/create_topic.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 pubsub_v1_generated_Publisher_CreateTopic_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the create_topic call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#create_topic. -# -def create_topic - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::Topic.new - - # Call the create_topic method. - result = client.create_topic request - - # The returned object is of type Google::Cloud::PubSub::V1::Topic. - p result -end -# [END pubsub_v1_generated_Publisher_CreateTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb deleted file mode 100644 index 8792a92b75b8..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/delete_topic.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 pubsub_v1_generated_Publisher_DeleteTopic_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the delete_topic call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#delete_topic. -# -def delete_topic - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::DeleteTopicRequest.new - - # Call the delete_topic method. - result = client.delete_topic request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_Publisher_DeleteTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb deleted file mode 100644 index dcc05f40ccb8..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.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 pubsub_v1_generated_Publisher_DetachSubscription_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the detach_subscription call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription. -# -def detach_subscription - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new - - # Call the detach_subscription method. - result = client.detach_subscription request - - # The returned object is of type Google::Cloud::PubSub::V1::DetachSubscriptionResponse. - p result -end -# [END pubsub_v1_generated_Publisher_DetachSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb deleted file mode 100644 index 0579fd51b1eb..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/get_topic.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 pubsub_v1_generated_Publisher_GetTopic_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the get_topic call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#get_topic. -# -def get_topic - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::GetTopicRequest.new - - # Call the get_topic method. - result = client.get_topic request - - # The returned object is of type Google::Cloud::PubSub::V1::Topic. - p result -end -# [END pubsub_v1_generated_Publisher_GetTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb deleted file mode 100644 index 7f4a911e41ec..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.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 pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_topic_snapshots call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots. -# -def list_topic_snapshots - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new - - # Call the list_topic_snapshots method. - result = client.list_topic_snapshots request - - # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse. - p result -end -# [END pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb deleted file mode 100644 index 090f8923ff6b..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.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 pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_topic_subscriptions call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions. -# -def list_topic_subscriptions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new - - # Call the list_topic_subscriptions method. - result = client.list_topic_subscriptions request - - # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse. - p result -end -# [END pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb deleted file mode 100644 index bd88ac920eb2..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/list_topics.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 pubsub_v1_generated_Publisher_ListTopics_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_topics call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#list_topics. -# -def list_topics - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListTopicsRequest.new - - # Call the list_topics method. - result = client.list_topics request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PubSub::V1::Topic. - p item - end -end -# [END pubsub_v1_generated_Publisher_ListTopics_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.rb deleted file mode 100644 index 5caab9b1b951..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/publish.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 pubsub_v1_generated_Publisher_Publish_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the publish call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#publish. -# -def publish - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::PublishRequest.new - - # Call the publish method. - result = client.publish request - - # The returned object is of type Google::Cloud::PubSub::V1::PublishResponse. - p result -end -# [END pubsub_v1_generated_Publisher_Publish_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb deleted file mode 100644 index 57c7befa74d9..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/publisher/update_topic.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 pubsub_v1_generated_Publisher_UpdateTopic_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the update_topic call in the Publisher service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Publisher::Client#update_topic. -# -def update_topic - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Publisher::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::UpdateTopicRequest.new - - # Call the update_topic method. - result = client.update_topic request - - # The returned object is of type Google::Cloud::PubSub::V1::Topic. - p result -end -# [END pubsub_v1_generated_Publisher_UpdateTopic_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.rb deleted file mode 100644 index a1bf37fbf92c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/commit_schema.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 pubsub_v1_generated_SchemaService_CommitSchema_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the commit_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#commit_schema. -# -def commit_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::CommitSchemaRequest.new - - # Call the commit_schema method. - result = client.commit_schema request - - # The returned object is of type Google::Cloud::PubSub::V1::Schema. - p result -end -# [END pubsub_v1_generated_SchemaService_CommitSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb deleted file mode 100644 index db03e1cc57d9..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/create_schema.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 pubsub_v1_generated_SchemaService_CreateSchema_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the create_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#create_schema. -# -def create_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::CreateSchemaRequest.new - - # Call the create_schema method. - result = client.create_schema request - - # The returned object is of type Google::Cloud::PubSub::V1::Schema. - p result -end -# [END pubsub_v1_generated_SchemaService_CreateSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb deleted file mode 100644 index c37a135f996e..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.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 pubsub_v1_generated_SchemaService_DeleteSchema_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the delete_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema. -# -def delete_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::DeleteSchemaRequest.new - - # Call the delete_schema method. - result = client.delete_schema request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.rb deleted file mode 100644 index 34402151bf28..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/delete_schema_revision.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 pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the delete_schema_revision call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema_revision. -# -def delete_schema_revision - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.new - - # Call the delete_schema_revision method. - result = client.delete_schema_revision request - - # The returned object is of type Google::Cloud::PubSub::V1::Schema. - p result -end -# [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb deleted file mode 100644 index f4034e461abe..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/get_schema.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 pubsub_v1_generated_SchemaService_GetSchema_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the get_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#get_schema. -# -def get_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::GetSchemaRequest.new - - # Call the get_schema method. - result = client.get_schema request - - # The returned object is of type Google::Cloud::PubSub::V1::Schema. - p result -end -# [END pubsub_v1_generated_SchemaService_GetSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_revisions.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_revisions.rb deleted file mode 100644 index 8a880de9fb9d..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schema_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 pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_schema_revisions call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#list_schema_revisions. -# -def list_schema_revisions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new - - # Call the list_schema_revisions method. - result = client.list_schema_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::PubSub::V1::Schema. - p item - end -end -# [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb deleted file mode 100644 index 4842a318d8d0..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.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 pubsub_v1_generated_SchemaService_ListSchemas_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_schemas call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas. -# -def list_schemas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListSchemasRequest.new - - # Call the list_schemas method. - result = client.list_schemas request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PubSub::V1::Schema. - p item - end -end -# [END pubsub_v1_generated_SchemaService_ListSchemas_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.rb deleted file mode 100644 index 89e822f9bd86..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/rollback_schema.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 pubsub_v1_generated_SchemaService_RollbackSchema_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the rollback_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#rollback_schema. -# -def rollback_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::RollbackSchemaRequest.new - - # Call the rollback_schema method. - result = client.rollback_schema request - - # The returned object is of type Google::Cloud::PubSub::V1::Schema. - p result -end -# [END pubsub_v1_generated_SchemaService_RollbackSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb deleted file mode 100644 index 3cc775cb8df8..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_message.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 pubsub_v1_generated_SchemaService_ValidateMessage_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the validate_message call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#validate_message. -# -def validate_message - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ValidateMessageRequest.new - - # Call the validate_message method. - result = client.validate_message request - - # The returned object is of type Google::Cloud::PubSub::V1::ValidateMessageResponse. - p result -end -# [END pubsub_v1_generated_SchemaService_ValidateMessage_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb deleted file mode 100644 index 9160d01f865c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.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 pubsub_v1_generated_SchemaService_ValidateSchema_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the validate_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema. -# -def validate_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ValidateSchemaRequest.new - - # Call the validate_schema method. - result = client.validate_schema request - - # The returned object is of type Google::Cloud::PubSub::V1::ValidateSchemaResponse. - p result -end -# [END pubsub_v1_generated_SchemaService_ValidateSchema_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json b/owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json deleted file mode 100644 index 9d8449734f3c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json +++ /dev/null @@ -1,1415 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-pubsub-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.pubsub.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "pubsub_v1_generated_SchemaService_CreateSchema_sync", - "title": "Snippet for the create_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#create_schema.", - "file": "schema_service/create_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_schema", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#create_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::CreateSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Schema", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "CreateSchema", - "full_name": "google.pubsub.v1.SchemaService.CreateSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_GetSchema_sync", - "title": "Snippet for the get_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#get_schema.", - "file": "schema_service/get_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_schema", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#get_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::GetSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Schema", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "GetSchema", - "full_name": "google.pubsub.v1.SchemaService.GetSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_ListSchemas_sync", - "title": "Snippet for the list_schemas call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas.", - "file": "schema_service/list_schemas.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_schemas", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListSchemasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListSchemasResponse", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "ListSchemas", - "full_name": "google.pubsub.v1.SchemaService.ListSchemas", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync", - "title": "Snippet for the list_schema_revisions call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#list_schema_revisions.", - "file": "schema_service/list_schema_revisions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_schema_revisions", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#list_schema_revisions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListSchemaRevisionsResponse", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "ListSchemaRevisions", - "full_name": "google.pubsub.v1.SchemaService.ListSchemaRevisions", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_CommitSchema_sync", - "title": "Snippet for the commit_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#commit_schema.", - "file": "schema_service/commit_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "commit_schema", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#commit_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::CommitSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Schema", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "CommitSchema", - "full_name": "google.pubsub.v1.SchemaService.CommitSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_RollbackSchema_sync", - "title": "Snippet for the rollback_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#rollback_schema.", - "file": "schema_service/rollback_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "rollback_schema", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#rollback_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::RollbackSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Schema", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "RollbackSchema", - "full_name": "google.pubsub.v1.SchemaService.RollbackSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync", - "title": "Snippet for the delete_schema_revision call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema_revision.", - "file": "schema_service/delete_schema_revision.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_schema_revision", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema_revision", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Schema", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "DeleteSchemaRevision", - "full_name": "google.pubsub.v1.SchemaService.DeleteSchemaRevision", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_DeleteSchema_sync", - "title": "Snippet for the delete_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema.", - "file": "schema_service/delete_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_schema", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::DeleteSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "DeleteSchema", - "full_name": "google.pubsub.v1.SchemaService.DeleteSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_ValidateSchema_sync", - "title": "Snippet for the validate_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema.", - "file": "schema_service/validate_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "validate_schema", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ValidateSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ValidateSchemaResponse", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "ValidateSchema", - "full_name": "google.pubsub.v1.SchemaService.ValidateSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_SchemaService_ValidateMessage_sync", - "title": "Snippet for the validate_message call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::SchemaService::Client#validate_message.", - "file": "schema_service/validate_message.rb", - "language": "RUBY", - "client_method": { - "short_name": "validate_message", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client#validate_message", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ValidateMessageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ValidateMessageResponse", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::PubSub::V1::SchemaService::Client" - }, - "method": { - "short_name": "ValidateMessage", - "full_name": "google.pubsub.v1.SchemaService.ValidateMessage", - "service": { - "short_name": "SchemaService", - "full_name": "google.pubsub.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_CreateTopic_sync", - "title": "Snippet for the create_topic call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#create_topic.", - "file": "publisher/create_topic.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_topic", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#create_topic", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::Topic", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Topic", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "CreateTopic", - "full_name": "google.pubsub.v1.Publisher.CreateTopic", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_UpdateTopic_sync", - "title": "Snippet for the update_topic call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#update_topic.", - "file": "publisher/update_topic.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_topic", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#update_topic", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::UpdateTopicRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Topic", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "UpdateTopic", - "full_name": "google.pubsub.v1.Publisher.UpdateTopic", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_Publish_sync", - "title": "Snippet for the publish call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#publish.", - "file": "publisher/publish.rb", - "language": "RUBY", - "client_method": { - "short_name": "publish", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#publish", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::PublishRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::PublishResponse", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "Publish", - "full_name": "google.pubsub.v1.Publisher.Publish", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_GetTopic_sync", - "title": "Snippet for the get_topic call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#get_topic.", - "file": "publisher/get_topic.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_topic", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#get_topic", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::GetTopicRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Topic", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "GetTopic", - "full_name": "google.pubsub.v1.Publisher.GetTopic", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_ListTopics_sync", - "title": "Snippet for the list_topics call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#list_topics.", - "file": "publisher/list_topics.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_topics", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#list_topics", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListTopicsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListTopicsResponse", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "ListTopics", - "full_name": "google.pubsub.v1.Publisher.ListTopics", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync", - "title": "Snippet for the list_topic_subscriptions call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions.", - "file": "publisher/list_topic_subscriptions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_topic_subscriptions", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "ListTopicSubscriptions", - "full_name": "google.pubsub.v1.Publisher.ListTopicSubscriptions", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_ListTopicSnapshots_sync", - "title": "Snippet for the list_topic_snapshots call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots.", - "file": "publisher/list_topic_snapshots.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_topic_snapshots", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "ListTopicSnapshots", - "full_name": "google.pubsub.v1.Publisher.ListTopicSnapshots", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_DeleteTopic_sync", - "title": "Snippet for the delete_topic call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#delete_topic.", - "file": "publisher/delete_topic.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_topic", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#delete_topic", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::DeleteTopicRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "DeleteTopic", - "full_name": "google.pubsub.v1.Publisher.DeleteTopic", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Publisher_DetachSubscription_sync", - "title": "Snippet for the detach_subscription call in the Publisher service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription.", - "file": "publisher/detach_subscription.rb", - "language": "RUBY", - "client_method": { - "short_name": "detach_subscription", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::DetachSubscriptionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::DetachSubscriptionResponse", - "client": { - "short_name": "Publisher::Client", - "full_name": "::Google::Cloud::PubSub::V1::Publisher::Client" - }, - "method": { - "short_name": "DetachSubscription", - "full_name": "google.pubsub.v1.Publisher.DetachSubscription", - "service": { - "short_name": "Publisher", - "full_name": "google.pubsub.v1.Publisher" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_CreateSubscription_sync", - "title": "Snippet for the create_subscription call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription.", - "file": "subscriber/create_subscription.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_subscription", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::Subscription", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Subscription", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "CreateSubscription", - "full_name": "google.pubsub.v1.Subscriber.CreateSubscription", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_GetSubscription_sync", - "title": "Snippet for the get_subscription call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription.", - "file": "subscriber/get_subscription.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_subscription", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::GetSubscriptionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Subscription", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "GetSubscription", - "full_name": "google.pubsub.v1.Subscriber.GetSubscription", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_UpdateSubscription_sync", - "title": "Snippet for the update_subscription call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription.", - "file": "subscriber/update_subscription.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_subscription", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Subscription", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "UpdateSubscription", - "full_name": "google.pubsub.v1.Subscriber.UpdateSubscription", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_ListSubscriptions_sync", - "title": "Snippet for the list_subscriptions call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions.", - "file": "subscriber/list_subscriptions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_subscriptions", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListSubscriptionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListSubscriptionsResponse", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "ListSubscriptions", - "full_name": "google.pubsub.v1.Subscriber.ListSubscriptions", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_DeleteSubscription_sync", - "title": "Snippet for the delete_subscription call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription.", - "file": "subscriber/delete_subscription.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_subscription", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "DeleteSubscription", - "full_name": "google.pubsub.v1.Subscriber.DeleteSubscription", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync", - "title": "Snippet for the modify_ack_deadline call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline.", - "file": "subscriber/modify_ack_deadline.rb", - "language": "RUBY", - "client_method": { - "short_name": "modify_ack_deadline", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "ModifyAckDeadline", - "full_name": "google.pubsub.v1.Subscriber.ModifyAckDeadline", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_Acknowledge_sync", - "title": "Snippet for the acknowledge call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge.", - "file": "subscriber/acknowledge.rb", - "language": "RUBY", - "client_method": { - "short_name": "acknowledge", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::AcknowledgeRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "Acknowledge", - "full_name": "google.pubsub.v1.Subscriber.Acknowledge", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_Pull_sync", - "title": "Snippet for the pull call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#pull.", - "file": "subscriber/pull.rb", - "language": "RUBY", - "client_method": { - "short_name": "pull", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#pull", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::PullRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::PullResponse", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "Pull", - "full_name": "google.pubsub.v1.Subscriber.Pull", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_StreamingPull_sync", - "title": "Snippet for the streaming_pull call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull.", - "file": "subscriber/streaming_pull.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_pull", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::StreamingPullRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::StreamingPullResponse", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "StreamingPull", - "full_name": "google.pubsub.v1.Subscriber.StreamingPull", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_ModifyPushConfig_sync", - "title": "Snippet for the modify_push_config call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config.", - "file": "subscriber/modify_push_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "modify_push_config", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ModifyPushConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "ModifyPushConfig", - "full_name": "google.pubsub.v1.Subscriber.ModifyPushConfig", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_GetSnapshot_sync", - "title": "Snippet for the get_snapshot call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot.", - "file": "subscriber/get_snapshot.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_snapshot", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::GetSnapshotRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Snapshot", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "GetSnapshot", - "full_name": "google.pubsub.v1.Subscriber.GetSnapshot", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_ListSnapshots_sync", - "title": "Snippet for the list_snapshots call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots.", - "file": "subscriber/list_snapshots.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_snapshots", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::ListSnapshotsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::ListSnapshotsResponse", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "ListSnapshots", - "full_name": "google.pubsub.v1.Subscriber.ListSnapshots", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_CreateSnapshot_sync", - "title": "Snippet for the create_snapshot call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot.", - "file": "subscriber/create_snapshot.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_snapshot", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::CreateSnapshotRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Snapshot", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "CreateSnapshot", - "full_name": "google.pubsub.v1.Subscriber.CreateSnapshot", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_UpdateSnapshot_sync", - "title": "Snippet for the update_snapshot call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot.", - "file": "subscriber/update_snapshot.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_snapshot", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::UpdateSnapshotRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::Snapshot", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "UpdateSnapshot", - "full_name": "google.pubsub.v1.Subscriber.UpdateSnapshot", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_DeleteSnapshot_sync", - "title": "Snippet for the delete_snapshot call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot.", - "file": "subscriber/delete_snapshot.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_snapshot", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::DeleteSnapshotRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "DeleteSnapshot", - "full_name": "google.pubsub.v1.Subscriber.DeleteSnapshot", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "pubsub_v1_generated_Subscriber_Seek_sync", - "title": "Snippet for the seek call in the Subscriber service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::PubSub::V1::Subscriber::Client#seek.", - "file": "subscriber/seek.rb", - "language": "RUBY", - "client_method": { - "short_name": "seek", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client#seek", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::PubSub::V1::SeekRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::PubSub::V1::SeekResponse", - "client": { - "short_name": "Subscriber::Client", - "full_name": "::Google::Cloud::PubSub::V1::Subscriber::Client" - }, - "method": { - "short_name": "Seek", - "full_name": "google.pubsub.v1.Subscriber.Seek", - "service": { - "short_name": "Subscriber", - "full_name": "google.pubsub.v1.Subscriber" - } - } - }, - "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-pubsub-v1/snippets/subscriber/acknowledge.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb deleted file mode 100644 index 1fb519824031..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.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 pubsub_v1_generated_Subscriber_Acknowledge_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the acknowledge call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge. -# -def acknowledge - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new - - # Call the acknowledge method. - result = client.acknowledge request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_Subscriber_Acknowledge_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb deleted file mode 100644 index a25c79ac750b..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.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 pubsub_v1_generated_Subscriber_CreateSnapshot_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the create_snapshot call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot. -# -def create_snapshot - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new - - # Call the create_snapshot method. - result = client.create_snapshot request - - # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. - p result -end -# [END pubsub_v1_generated_Subscriber_CreateSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb deleted file mode 100644 index 6b3cb1294739..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.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 pubsub_v1_generated_Subscriber_CreateSubscription_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the create_subscription call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription. -# -def create_subscription - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::Subscription.new - - # Call the create_subscription method. - result = client.create_subscription request - - # The returned object is of type Google::Cloud::PubSub::V1::Subscription. - p result -end -# [END pubsub_v1_generated_Subscriber_CreateSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb deleted file mode 100644 index 43449c44ba7a..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.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 pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the delete_snapshot call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot. -# -def delete_snapshot - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new - - # Call the delete_snapshot method. - result = client.delete_snapshot request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb deleted file mode 100644 index 6ef94c7aa27a..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.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 pubsub_v1_generated_Subscriber_DeleteSubscription_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the delete_subscription call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription. -# -def delete_subscription - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new - - # Call the delete_subscription method. - result = client.delete_subscription request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_Subscriber_DeleteSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb deleted file mode 100644 index 51b63dff8e75..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.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 pubsub_v1_generated_Subscriber_GetSnapshot_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the get_snapshot call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot. -# -def get_snapshot - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new - - # Call the get_snapshot method. - result = client.get_snapshot request - - # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. - p result -end -# [END pubsub_v1_generated_Subscriber_GetSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb deleted file mode 100644 index c99685381eda..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.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 pubsub_v1_generated_Subscriber_GetSubscription_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the get_subscription call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription. -# -def get_subscription - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new - - # Call the get_subscription method. - result = client.get_subscription request - - # The returned object is of type Google::Cloud::PubSub::V1::Subscription. - p result -end -# [END pubsub_v1_generated_Subscriber_GetSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb deleted file mode 100644 index 9ee8b02af0a8..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.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 pubsub_v1_generated_Subscriber_ListSnapshots_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_snapshots call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots. -# -def list_snapshots - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new - - # Call the list_snapshots method. - result = client.list_snapshots request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot. - p item - end -end -# [END pubsub_v1_generated_Subscriber_ListSnapshots_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb deleted file mode 100644 index d13b2449f414..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.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 pubsub_v1_generated_Subscriber_ListSubscriptions_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the list_subscriptions call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions. -# -def list_subscriptions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new - - # Call the list_subscriptions method. - result = client.list_subscriptions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::PubSub::V1::Subscription. - p item - end -end -# [END pubsub_v1_generated_Subscriber_ListSubscriptions_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb deleted file mode 100644 index 23298f534025..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.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 pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the modify_ack_deadline call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline. -# -def modify_ack_deadline - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new - - # Call the modify_ack_deadline method. - result = client.modify_ack_deadline request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb deleted file mode 100644 index dad858850239..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.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 pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the modify_push_config call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config. -# -def modify_push_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new - - # Call the modify_push_config method. - result = client.modify_push_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.rb deleted file mode 100644 index 3de44e085e5a..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/pull.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 pubsub_v1_generated_Subscriber_Pull_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the pull call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#pull. -# -def pull - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::PullRequest.new - - # Call the pull method. - result = client.pull request - - # The returned object is of type Google::Cloud::PubSub::V1::PullResponse. - p result -end -# [END pubsub_v1_generated_Subscriber_Pull_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.rb deleted file mode 100644 index 174ae99d732d..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/seek.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 pubsub_v1_generated_Subscriber_Seek_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the seek call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#seek. -# -def seek - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::SeekRequest.new - - # Call the seek method. - result = client.seek request - - # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse. - p result -end -# [END pubsub_v1_generated_Subscriber_Seek_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb deleted file mode 100644 index 3ecb1666a8a2..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.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! - -# [START pubsub_v1_generated_Subscriber_StreamingPull_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the streaming_pull call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull. -# -def streaming_pull - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_pull method to start streaming. - output = client.streaming_pull input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::PubSub::V1::StreamingPullRequest.new - input << Google::Cloud::PubSub::V1::StreamingPullRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::PubSub::V1::StreamingPullResponse - output.each do |current_response| - p current_response - end -end -# [END pubsub_v1_generated_Subscriber_StreamingPull_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb deleted file mode 100644 index b031ce613d1c..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.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 pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the update_snapshot call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot. -# -def update_snapshot - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new - - # Call the update_snapshot method. - result = client.update_snapshot request - - # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. - p result -end -# [END pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb b/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb deleted file mode 100644 index e4e8051bda1f..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.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 pubsub_v1_generated_Subscriber_UpdateSubscription_sync] -require "google/cloud/pubsub/v1" - -## -# Snippet for the update_subscription call in the Subscriber service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription. -# -def update_subscription - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::PubSub::V1::Subscriber::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new - - # Call the update_subscription method. - result = client.update_subscription request - - # The returned object is of type Google::Cloud::PubSub::V1::Subscription. - p result -end -# [END pubsub_v1_generated_Subscriber_UpdateSubscription_sync] diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb deleted file mode 100644 index e1b49a53126e..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_paths_test.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/pubsub/v1/publisher" - -class ::Google::Cloud::PubSub::V1::Publisher::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.schema_path project: "value0", schema: "value1" - assert_equal "projects/value0/schemas/value1", path - end - end - - def test_subscription_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.subscription_path project: "value0", subscription: "value1" - assert_equal "projects/value0/subscriptions/value1", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - - path = client.topic_path - assert_equal "_deleted-topic_", path - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb deleted file mode 100644 index 7254556e89bf..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/publisher_test.rb +++ /dev/null @@ -1,635 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/pubsub/v1/pubsub_pb" -require "google/pubsub/v1/pubsub_services_pb" -require "google/cloud/pubsub/v1/publisher" - -class ::Google::Cloud::PubSub::V1::Publisher::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_topic - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Topic.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - labels = {} - message_storage_policy = {} - kms_key_name = "hello world" - schema_settings = {} - satisfies_pzs = true - message_retention_duration = {} - state = :STATE_UNSPECIFIED - ingestion_data_source_settings = {} - - create_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_topic, name - assert_kind_of ::Google::Cloud::PubSub::V1::Topic, request - assert_equal "hello world", request["name"] - assert_equal({}, request["labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::MessageStoragePolicy), request["message_storage_policy"] - assert_equal "hello world", request["kms_key_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::SchemaSettings), request["schema_settings"] - assert_equal true, request["satisfies_pzs"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["message_retention_duration"] - assert_equal :STATE_UNSPECIFIED, request["state"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::IngestionDataSourceSettings), request["ingestion_data_source_settings"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_topic_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_topic({ name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_topic name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_topic ::Google::Cloud::PubSub::V1::Topic.new(name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_topic({ name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_topic(::Google::Cloud::PubSub::V1::Topic.new(name: name, labels: labels, message_storage_policy: message_storage_policy, kms_key_name: kms_key_name, schema_settings: schema_settings, satisfies_pzs: satisfies_pzs, message_retention_duration: message_retention_duration, state: state, ingestion_data_source_settings: ingestion_data_source_settings), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_topic_client_stub.call_rpc_count - end - end - - def test_update_topic - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Topic.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - topic = {} - update_mask = {} - - update_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_topic, name - assert_kind_of ::Google::Cloud::PubSub::V1::UpdateTopicRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Topic), request["topic"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_topic_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_topic({ topic: topic, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_topic topic: topic, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_topic ::Google::Cloud::PubSub::V1::UpdateTopicRequest.new(topic: topic, 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_topic({ topic: topic, 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_topic(::Google::Cloud::PubSub::V1::UpdateTopicRequest.new(topic: topic, 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_topic_client_stub.call_rpc_count - end - end - - def test_publish - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::PublishResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - topic = "hello world" - messages = [{}] - - publish_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :publish, name - assert_kind_of ::Google::Cloud::PubSub::V1::PublishRequest, request - assert_equal "hello world", request["topic"] - assert_kind_of ::Google::Cloud::PubSub::V1::PubsubMessage, request["messages"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, publish_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.publish({ topic: topic, messages: messages }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.publish topic: topic, messages: messages do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.publish ::Google::Cloud::PubSub::V1::PublishRequest.new(topic: topic, messages: messages) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.publish({ topic: topic, messages: messages }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.publish(::Google::Cloud::PubSub::V1::PublishRequest.new(topic: topic, messages: messages), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, publish_client_stub.call_rpc_count - end - end - - def test_get_topic - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Topic.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - topic = "hello world" - - get_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_topic, name - assert_kind_of ::Google::Cloud::PubSub::V1::GetTopicRequest, request - assert_equal "hello world", request["topic"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_topic_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_topic({ topic: topic }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_topic topic: topic do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_topic ::Google::Cloud::PubSub::V1::GetTopicRequest.new(topic: topic) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_topic({ topic: topic }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_topic(::Google::Cloud::PubSub::V1::GetTopicRequest.new(topic: topic), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_topic_client_stub.call_rpc_count - end - end - - def test_list_topics - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListTopicsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - page_size = 42 - page_token = "hello world" - - list_topics_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_topics, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListTopicsRequest, request - assert_equal "hello world", request["project"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_topics_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_topics({ project: project, page_size: page_size, page_token: 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_topics project: project, page_size: page_size, page_token: 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_topics ::Google::Cloud::PubSub::V1::ListTopicsRequest.new(project: project, page_size: page_size, page_token: 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_topics({ project: project, 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_topics(::Google::Cloud::PubSub::V1::ListTopicsRequest.new(project: project, 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_topics_client_stub.call_rpc_count - end - end - - def test_list_topic_subscriptions - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - topic = "hello world" - page_size = 42 - page_token = "hello world" - - list_topic_subscriptions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_topic_subscriptions, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest, request - assert_equal "hello world", request["topic"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_topic_subscriptions_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_topic_subscriptions({ topic: topic, page_size: page_size, page_token: page_token }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_topic_subscriptions topic: topic, page_size: page_size, page_token: page_token do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_topic_subscriptions ::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new(topic: topic, page_size: page_size, page_token: page_token) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_topic_subscriptions({ topic: topic, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_topic_subscriptions(::Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new(topic: topic, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_topic_subscriptions_client_stub.call_rpc_count - end - end - - def test_list_topic_snapshots - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - topic = "hello world" - page_size = 42 - page_token = "hello world" - - list_topic_snapshots_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_topic_snapshots, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest, request - assert_equal "hello world", request["topic"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_topic_snapshots_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_topic_snapshots({ topic: topic, page_size: page_size, page_token: page_token }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_topic_snapshots topic: topic, page_size: page_size, page_token: page_token do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_topic_snapshots ::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new(topic: topic, page_size: page_size, page_token: page_token) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_topic_snapshots({ topic: topic, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_topic_snapshots(::Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new(topic: topic, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_topic_snapshots_client_stub.call_rpc_count - end - end - - def test_delete_topic - # 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. - topic = "hello world" - - delete_topic_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_topic, name - assert_kind_of ::Google::Cloud::PubSub::V1::DeleteTopicRequest, request - assert_equal "hello world", request["topic"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_topic_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_topic({ topic: topic }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_topic topic: topic do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_topic ::Google::Cloud::PubSub::V1::DeleteTopicRequest.new(topic: topic) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_topic({ topic: topic }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_topic(::Google::Cloud::PubSub::V1::DeleteTopicRequest.new(topic: topic), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_topic_client_stub.call_rpc_count - end - end - - def test_detach_subscription - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::DetachSubscriptionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - subscription = "hello world" - - detach_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :detach_subscription, name - assert_kind_of ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest, request - assert_equal "hello world", request["subscription"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, detach_subscription_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Publisher::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.detach_subscription({ subscription: subscription }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.detach_subscription subscription: subscription do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.detach_subscription ::Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new(subscription: subscription) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.detach_subscription({ subscription: subscription }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.detach_subscription(::Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new(subscription: subscription), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, detach_subscription_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::PubSub::V1::Publisher::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::PubSub::V1::Publisher::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb deleted file mode 100644 index 12a4779fa779..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_paths_test.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/pubsub/v1/schema_service" - -class ::Google::Cloud::PubSub::V1::SchemaService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.schema_path project: "value0", schema: "value1" - assert_equal "projects/value0/schemas/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.rb deleted file mode 100644 index fad97a2bdf6a..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/schema_service_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/pubsub/v1/schema_pb" -require "google/pubsub/v1/schema_services_pb" -require "google/cloud/pubsub/v1/schema_service" - -class ::Google::Cloud::PubSub::V1::SchemaService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Schema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - schema = {} - schema_id = "hello world" - - create_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_schema, name - assert_kind_of ::Google::Cloud::PubSub::V1::CreateSchemaRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Schema), request["schema"] - assert_equal "hello world", request["schema_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_schema_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_schema parent: parent, schema: schema, schema_id: schema_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_schema ::Google::Cloud::PubSub::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_schema(::Google::Cloud::PubSub::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_schema_client_stub.call_rpc_count - end - end - - def test_get_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Schema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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 = :SCHEMA_VIEW_UNSPECIFIED - - get_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_schema, name - assert_kind_of ::Google::Cloud::PubSub::V1::GetSchemaRequest, request - assert_equal "hello world", request["name"] - assert_equal :SCHEMA_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_schema_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_schema({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_schema name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_schema ::Google::Cloud::PubSub::V1::GetSchemaRequest.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_schema({ 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_schema(::Google::Cloud::PubSub::V1::GetSchemaRequest.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_schema_client_stub.call_rpc_count - end - end - - def test_list_schemas - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListSchemasResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - view = :SCHEMA_VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_schemas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_schemas, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListSchemasRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SCHEMA_VIEW_UNSPECIFIED, request["view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_schemas_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_schemas({ parent: parent, view: 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_schemas parent: parent, view: 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_schemas ::Google::Cloud::PubSub::V1::ListSchemasRequest.new(parent: parent, view: 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_schemas({ parent: parent, view: 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_schemas(::Google::Cloud::PubSub::V1::ListSchemasRequest.new(parent: parent, view: 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_schemas_client_stub.call_rpc_count - end - end - - def test_list_schema_revisions - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListSchemaRevisionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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 = :SCHEMA_VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_schema_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_schema_revisions, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest, request - assert_equal "hello world", request["name"] - assert_equal :SCHEMA_VIEW_UNSPECIFIED, request["view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_schema_revisions_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_schema_revisions({ name: name, view: 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_schema_revisions name: name, view: 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_schema_revisions ::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new(name: name, view: 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_schema_revisions({ name: name, view: 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_schema_revisions(::Google::Cloud::PubSub::V1::ListSchemaRevisionsRequest.new(name: name, view: 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_schema_revisions_client_stub.call_rpc_count - end - end - - def test_commit_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Schema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - schema = {} - - commit_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :commit_schema, name - assert_kind_of ::Google::Cloud::PubSub::V1::CommitSchemaRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Schema), request["schema"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, commit_schema_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.commit_schema({ name: name, schema: schema }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.commit_schema name: name, schema: schema do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.commit_schema ::Google::Cloud::PubSub::V1::CommitSchemaRequest.new(name: name, schema: schema) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.commit_schema({ name: name, schema: schema }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.commit_schema(::Google::Cloud::PubSub::V1::CommitSchemaRequest.new(name: name, schema: schema), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, commit_schema_client_stub.call_rpc_count - end - end - - def test_rollback_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Schema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rollback_schema, name - assert_kind_of ::Google::Cloud::PubSub::V1::RollbackSchemaRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["revision_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rollback_schema_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rollback_schema({ 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_schema 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_schema ::Google::Cloud::PubSub::V1::RollbackSchemaRequest.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_schema({ 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_schema(::Google::Cloud::PubSub::V1::RollbackSchemaRequest.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_schema_client_stub.call_rpc_count - end - end - - def test_delete_schema_revision - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Schema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - - delete_schema_revision_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_schema_revision, name - assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["revision_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_schema_revision_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_schema_revision({ name: name, revision_id: revision_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_schema_revision name: name, revision_id: revision_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_schema_revision ::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.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.delete_schema_revision({ 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.delete_schema_revision(::Google::Cloud::PubSub::V1::DeleteSchemaRevisionRequest.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, delete_schema_revision_client_stub.call_rpc_count - end - end - - def test_delete_schema - # 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_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_schema, name - assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSchemaRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_schema_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_schema({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_schema name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_schema ::Google::Cloud::PubSub::V1::DeleteSchemaRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_schema({ 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_schema(::Google::Cloud::PubSub::V1::DeleteSchemaRequest.new(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_schema_client_stub.call_rpc_count - end - end - - def test_validate_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ValidateSchemaResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - schema = {} - - validate_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :validate_schema, name - assert_kind_of ::Google::Cloud::PubSub::V1::ValidateSchemaRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Schema), request["schema"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, validate_schema_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.validate_schema({ parent: parent, schema: schema }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.validate_schema parent: parent, schema: schema do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.validate_schema ::Google::Cloud::PubSub::V1::ValidateSchemaRequest.new(parent: parent, schema: schema) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.validate_schema({ parent: parent, schema: schema }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.validate_schema(::Google::Cloud::PubSub::V1::ValidateSchemaRequest.new(parent: parent, schema: schema), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, validate_schema_client_stub.call_rpc_count - end - end - - def test_validate_message - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ValidateMessageResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - name = "hello world" - message = "hello world" - encoding = :ENCODING_UNSPECIFIED - - validate_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :validate_message, name - assert_kind_of ::Google::Cloud::PubSub::V1::ValidateMessageRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["name"] - assert_equal :name, request.schema_spec - assert_equal "hello world", request["message"] - assert_equal :ENCODING_UNSPECIFIED, request["encoding"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, validate_message_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.validate_message({ parent: parent, name: name, message: message, encoding: encoding }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.validate_message parent: parent, name: name, message: message, encoding: encoding do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.validate_message ::Google::Cloud::PubSub::V1::ValidateMessageRequest.new(parent: parent, name: name, message: message, encoding: encoding) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.validate_message({ parent: parent, name: name, message: message, encoding: encoding }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.validate_message(::Google::Cloud::PubSub::V1::ValidateMessageRequest.new(parent: parent, name: name, message: message, encoding: encoding), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, validate_message_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::PubSub::V1::SchemaService::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::PubSub::V1::SchemaService::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb deleted file mode 100644 index fd533a166edb..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_paths_test.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/pubsub/v1/subscriber" - -class ::Google::Cloud::PubSub::V1::Subscriber::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_snapshot_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.snapshot_path project: "value0", snapshot: "value1" - assert_equal "projects/value0/snapshots/value1", path - end - end - - def test_subscription_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.subscription_path project: "value0", subscription: "value1" - assert_equal "projects/value0/subscriptions/value1", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - - path = client.topic_path - assert_equal "_deleted-topic_", path - end - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb deleted file mode 100644 index 81627bbb9f3f..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/google/cloud/pubsub/v1/subscriber_test.rb +++ /dev/null @@ -1,1123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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/pubsub/v1/pubsub_pb" -require "google/pubsub/v1/pubsub_services_pb" -require "google/cloud/pubsub/v1/subscriber" - -class ::Google::Cloud::PubSub::V1::Subscriber::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_subscription - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Subscription.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - topic = "hello world" - push_config = {} - bigquery_config = {} - cloud_storage_config = {} - ack_deadline_seconds = 42 - retain_acked_messages = true - message_retention_duration = {} - labels = {} - enable_message_ordering = true - expiration_policy = {} - filter = "hello world" - dead_letter_policy = {} - retry_policy = {} - detached = true - enable_exactly_once_delivery = true - topic_message_retention_duration = {} - state = :STATE_UNSPECIFIED - - create_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_subscription, name - assert_kind_of ::Google::Cloud::PubSub::V1::Subscription, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["topic"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::PushConfig), request["push_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::BigQueryConfig), request["bigquery_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::CloudStorageConfig), request["cloud_storage_config"] - assert_equal 42, request["ack_deadline_seconds"] - assert_equal true, request["retain_acked_messages"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["message_retention_duration"] - assert_equal({}, request["labels"].to_h) - assert_equal true, request["enable_message_ordering"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::ExpirationPolicy), request["expiration_policy"] - assert_equal "hello world", request["filter"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::DeadLetterPolicy), request["dead_letter_policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::RetryPolicy), request["retry_policy"] - assert_equal true, request["detached"] - assert_equal true, request["enable_exactly_once_delivery"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["topic_message_retention_duration"] - assert_equal :STATE_UNSPECIFIED, request["state"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_subscription_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_subscription({ name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_subscription name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_subscription ::Google::Cloud::PubSub::V1::Subscription.new(name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_subscription({ name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_subscription(::Google::Cloud::PubSub::V1::Subscription.new(name: name, topic: topic, push_config: push_config, bigquery_config: bigquery_config, cloud_storage_config: cloud_storage_config, ack_deadline_seconds: ack_deadline_seconds, retain_acked_messages: retain_acked_messages, message_retention_duration: message_retention_duration, labels: labels, enable_message_ordering: enable_message_ordering, expiration_policy: expiration_policy, filter: filter, dead_letter_policy: dead_letter_policy, retry_policy: retry_policy, detached: detached, enable_exactly_once_delivery: enable_exactly_once_delivery, topic_message_retention_duration: topic_message_retention_duration, state: state), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_subscription_client_stub.call_rpc_count - end - end - - def test_get_subscription - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Subscription.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - subscription = "hello world" - - get_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_subscription, name - assert_kind_of ::Google::Cloud::PubSub::V1::GetSubscriptionRequest, request - assert_equal "hello world", request["subscription"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_subscription_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_subscription({ subscription: subscription }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_subscription subscription: subscription do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_subscription ::Google::Cloud::PubSub::V1::GetSubscriptionRequest.new(subscription: subscription) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_subscription({ subscription: subscription }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_subscription(::Google::Cloud::PubSub::V1::GetSubscriptionRequest.new(subscription: subscription), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_subscription_client_stub.call_rpc_count - end - end - - def test_update_subscription - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Subscription.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - subscription = {} - update_mask = {} - - update_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_subscription, name - assert_kind_of ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Subscription), request["subscription"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_subscription_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_subscription({ subscription: subscription, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_subscription subscription: subscription, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_subscription ::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new(subscription: subscription, 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_subscription({ subscription: subscription, 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_subscription(::Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new(subscription: subscription, 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_subscription_client_stub.call_rpc_count - end - end - - def test_list_subscriptions - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListSubscriptionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - page_size = 42 - page_token = "hello world" - - list_subscriptions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_subscriptions, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest, request - assert_equal "hello world", request["project"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_subscriptions_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_subscriptions({ project: project, page_size: page_size, page_token: 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_subscriptions project: project, page_size: page_size, page_token: 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_subscriptions ::Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new(project: project, page_size: page_size, page_token: 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_subscriptions({ project: project, 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_subscriptions(::Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new(project: project, 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_subscriptions_client_stub.call_rpc_count - end - end - - def test_delete_subscription - # 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. - subscription = "hello world" - - delete_subscription_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_subscription, name - assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest, request - assert_equal "hello world", request["subscription"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_subscription_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_subscription({ subscription: subscription }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_subscription subscription: subscription do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_subscription ::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new(subscription: subscription) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_subscription({ subscription: subscription }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_subscription(::Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new(subscription: subscription), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_subscription_client_stub.call_rpc_count - end - end - - def test_modify_ack_deadline - # 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. - subscription = "hello world" - ack_ids = ["hello world"] - ack_deadline_seconds = 42 - - modify_ack_deadline_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :modify_ack_deadline, name - assert_kind_of ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest, request - assert_equal "hello world", request["subscription"] - assert_equal ["hello world"], request["ack_ids"] - assert_equal 42, request["ack_deadline_seconds"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, modify_ack_deadline_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.modify_ack_deadline({ subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.modify_ack_deadline subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.modify_ack_deadline ::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new(subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.modify_ack_deadline({ subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.modify_ack_deadline(::Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new(subscription: subscription, ack_ids: ack_ids, ack_deadline_seconds: ack_deadline_seconds), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, modify_ack_deadline_client_stub.call_rpc_count - end - end - - def test_acknowledge - # 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. - subscription = "hello world" - ack_ids = ["hello world"] - - acknowledge_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :acknowledge, name - assert_kind_of ::Google::Cloud::PubSub::V1::AcknowledgeRequest, request - assert_equal "hello world", request["subscription"] - assert_equal ["hello world"], request["ack_ids"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, acknowledge_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.acknowledge({ subscription: subscription, ack_ids: ack_ids }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.acknowledge subscription: subscription, ack_ids: ack_ids do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.acknowledge ::Google::Cloud::PubSub::V1::AcknowledgeRequest.new(subscription: subscription, ack_ids: ack_ids) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.acknowledge({ subscription: subscription, ack_ids: ack_ids }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.acknowledge(::Google::Cloud::PubSub::V1::AcknowledgeRequest.new(subscription: subscription, ack_ids: ack_ids), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, acknowledge_client_stub.call_rpc_count - end - end - - def test_pull - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::PullResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - subscription = "hello world" - return_immediately = true - max_messages = 42 - - pull_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pull, name - assert_kind_of ::Google::Cloud::PubSub::V1::PullRequest, request - assert_equal "hello world", request["subscription"] - assert_equal true, request["return_immediately"] - assert_equal 42, request["max_messages"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pull_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pull({ subscription: subscription, return_immediately: return_immediately, max_messages: max_messages }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pull subscription: subscription, return_immediately: return_immediately, max_messages: max_messages do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pull ::Google::Cloud::PubSub::V1::PullRequest.new(subscription: subscription, return_immediately: return_immediately, max_messages: max_messages) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pull({ subscription: subscription, return_immediately: return_immediately, max_messages: max_messages }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pull(::Google::Cloud::PubSub::V1::PullRequest.new(subscription: subscription, return_immediately: return_immediately, max_messages: max_messages), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, pull_client_stub.call_rpc_count - end - end - - def test_streaming_pull - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::StreamingPullResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a bidi streaming method. - subscription = "hello world" - ack_ids = ["hello world"] - modify_deadline_seconds = [42] - modify_deadline_ack_ids = ["hello world"] - stream_ack_deadline_seconds = 42 - client_id = "hello world" - max_outstanding_messages = 42 - max_outstanding_bytes = 42 - - streaming_pull_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_pull, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_pull_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } - request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes - enum_input = [request_hash, request_proto].to_enum - client.streaming_pull enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } - request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes - stream_input = Gapic::StreamInput.new - client.streaming_pull stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } - request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes - enum_input = [request_hash, request_proto].to_enum - client.streaming_pull enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes } - request_proto = ::Google::Cloud::PubSub::V1::StreamingPullRequest.new subscription: subscription, ack_ids: ack_ids, modify_deadline_seconds: modify_deadline_seconds, modify_deadline_ack_ids: modify_deadline_ack_ids, stream_ack_deadline_seconds: stream_ack_deadline_seconds, client_id: client_id, max_outstanding_messages: max_outstanding_messages, max_outstanding_bytes: max_outstanding_bytes - stream_input = Gapic::StreamInput.new - client.streaming_pull stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_pull_client_stub.call_rpc_count - streaming_pull_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::PubSub::V1::StreamingPullRequest, r - assert_equal "hello world", r["subscription"] - assert_equal ["hello world"], r["ack_ids"] - assert_equal [42], r["modify_deadline_seconds"] - assert_equal ["hello world"], r["modify_deadline_ack_ids"] - assert_equal 42, r["stream_ack_deadline_seconds"] - assert_equal "hello world", r["client_id"] - assert_equal 42, r["max_outstanding_messages"] - assert_equal 42, r["max_outstanding_bytes"] - end - end - end - end - - def test_modify_push_config - # 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. - subscription = "hello world" - push_config = {} - - modify_push_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :modify_push_config, name - assert_kind_of ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest, request - assert_equal "hello world", request["subscription"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::PushConfig), request["push_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, modify_push_config_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.modify_push_config({ subscription: subscription, push_config: push_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.modify_push_config subscription: subscription, push_config: push_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.modify_push_config ::Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new(subscription: subscription, push_config: push_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.modify_push_config({ subscription: subscription, push_config: push_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.modify_push_config(::Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new(subscription: subscription, push_config: push_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, modify_push_config_client_stub.call_rpc_count - end - end - - def test_get_snapshot - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Snapshot.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - snapshot = "hello world" - - get_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_snapshot, name - assert_kind_of ::Google::Cloud::PubSub::V1::GetSnapshotRequest, request - assert_equal "hello world", request["snapshot"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_snapshot_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_snapshot({ snapshot: snapshot }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_snapshot snapshot: snapshot do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_snapshot ::Google::Cloud::PubSub::V1::GetSnapshotRequest.new(snapshot: snapshot) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_snapshot({ snapshot: snapshot }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_snapshot(::Google::Cloud::PubSub::V1::GetSnapshotRequest.new(snapshot: snapshot), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_snapshot_client_stub.call_rpc_count - end - end - - def test_list_snapshots - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::ListSnapshotsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - page_size = 42 - page_token = "hello world" - - list_snapshots_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_snapshots, name - assert_kind_of ::Google::Cloud::PubSub::V1::ListSnapshotsRequest, request - assert_equal "hello world", request["project"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_snapshots_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_snapshots({ project: project, page_size: page_size, page_token: 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_snapshots project: project, page_size: page_size, page_token: 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_snapshots ::Google::Cloud::PubSub::V1::ListSnapshotsRequest.new(project: project, page_size: page_size, page_token: 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_snapshots({ project: project, 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_snapshots(::Google::Cloud::PubSub::V1::ListSnapshotsRequest.new(project: project, 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_snapshots_client_stub.call_rpc_count - end - end - - def test_create_snapshot - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Snapshot.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - subscription = "hello world" - labels = {} - - create_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_snapshot, name - assert_kind_of ::Google::Cloud::PubSub::V1::CreateSnapshotRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["subscription"] - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_snapshot_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_snapshot({ name: name, subscription: subscription, labels: labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_snapshot name: name, subscription: subscription, labels: labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_snapshot ::Google::Cloud::PubSub::V1::CreateSnapshotRequest.new(name: name, subscription: subscription, labels: labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_snapshot({ name: name, subscription: subscription, labels: labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_snapshot(::Google::Cloud::PubSub::V1::CreateSnapshotRequest.new(name: name, subscription: subscription, labels: labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_snapshot_client_stub.call_rpc_count - end - end - - def test_update_snapshot - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::Snapshot.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - snapshot = {} - update_mask = {} - - update_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_snapshot, name - assert_kind_of ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::PubSub::V1::Snapshot), request["snapshot"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_snapshot_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_snapshot({ snapshot: snapshot, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_snapshot snapshot: snapshot, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_snapshot ::Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new(snapshot: snapshot, 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_snapshot({ snapshot: snapshot, 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_snapshot(::Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new(snapshot: snapshot, 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_snapshot_client_stub.call_rpc_count - end - end - - def test_delete_snapshot - # 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. - snapshot = "hello world" - - delete_snapshot_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_snapshot, name - assert_kind_of ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest, request - assert_equal "hello world", request["snapshot"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_snapshot_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_snapshot({ snapshot: snapshot }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_snapshot snapshot: snapshot do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_snapshot ::Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new(snapshot: snapshot) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_snapshot({ snapshot: snapshot }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_snapshot(::Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new(snapshot: snapshot), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_snapshot_client_stub.call_rpc_count - end - end - - def test_seek - # Create GRPC objects. - grpc_response = ::Google::Cloud::PubSub::V1::SeekResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - subscription = "hello world" - time = {} - - seek_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :seek, name - assert_kind_of ::Google::Cloud::PubSub::V1::SeekRequest, request - assert_equal "hello world", request["subscription"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["time"] - assert_equal :time, request.target - refute_nil options - end - - Gapic::ServiceStub.stub :new, seek_client_stub do - # Create client - client = ::Google::Cloud::PubSub::V1::Subscriber::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.seek({ subscription: subscription, time: time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.seek subscription: subscription, time: time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.seek ::Google::Cloud::PubSub::V1::SeekRequest.new(subscription: subscription, time: time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.seek({ subscription: subscription, time: time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.seek(::Google::Cloud::PubSub::V1::SeekRequest.new(subscription: subscription, time: time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, seek_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::PubSub::V1::Subscriber::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::PubSub::V1::Subscriber::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb b/owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb deleted file mode 100644 index 48407bca7edb..000000000000 --- a/owl-bot-staging/google-cloud-pubsub-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"