From b0d4c0652cde84d6d3949d9c1b75bba26d42ff7d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 8 Nov 2023 23:53:12 +0000 Subject: [PATCH 1/2] docs: correct timezone/offset information for Cloud Scheduler headers PiperOrigin-RevId: 580635787 Source-Link: https://github.com/googleapis/googleapis/commit/72f179600170dfde33df5775c730b189962f5ddc Source-Link: https://github.com/googleapis/googleapis-gen/commit/0aa0f8d0564548a72335d718361f357fcb73dbe8 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNjaGVkdWxlci12MS8uT3dsQm90LnlhbWwiLCJoIjoiMGFhMGY4ZDA1NjQ1NDhhNzIzMzVkNzE4MzYxZjM1N2ZjYjczZGJlOCJ9 --- .../google-cloud-scheduler-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-scheduler-v1/.rubocop.yml | 33 + .../google-cloud-scheduler-v1/.yardopts | 12 + .../AUTHENTICATION.md | 151 +++ .../google-cloud-scheduler-v1/CHANGELOG.md | 2 + .../google-cloud-scheduler-v1/Gemfile | 3 + .../google-cloud-scheduler-v1/LICENSE.md | 201 +++ .../google-cloud-scheduler-v1/README.md | 144 ++ .../google-cloud-scheduler-v1/Rakefile | 201 +++ .../gapic_metadata.json | 58 + .../google-cloud-scheduler-v1.gemspec | 38 + .../lib/google-cloud-scheduler-v1.rb | 21 + .../lib/google/cloud/scheduler/v1.rb | 45 + .../cloud/scheduler/v1/bindings_override.rb | 102 ++ .../cloud/scheduler/v1/cloud_scheduler.rb | 56 + .../scheduler/v1/cloud_scheduler/client.rb | 1154 +++++++++++++++++ .../v1/cloud_scheduler/credentials.rb | 51 + .../scheduler/v1/cloud_scheduler/paths.rb | 86 ++ .../scheduler/v1/cloud_scheduler/rest.rb | 54 + .../v1/cloud_scheduler/rest/client.rb | 1077 +++++++++++++++ .../v1/cloud_scheduler/rest/service_stub.rb | 525 ++++++++ .../cloud/scheduler/v1/cloudscheduler_pb.rb | 60 + .../v1/cloudscheduler_services_pb.rb | 89 ++ .../lib/google/cloud/scheduler/v1/job_pb.rb | 54 + .../lib/google/cloud/scheduler/v1/rest.rb | 38 + .../google/cloud/scheduler/v1/target_pb.rb | 50 + .../lib/google/cloud/scheduler/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 381 ++++++ .../proto_docs/google/api/field_behavior.rb | 85 ++ .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 222 ++++ .../cloud/scheduler/v1/cloudscheduler.rb | 168 +++ .../google/cloud/scheduler/v1/job.rb | 253 ++++ .../google/cloud/scheduler/v1/target.rb | 403 ++++++ .../proto_docs/google/protobuf/any.rb | 144 ++ .../proto_docs/google/protobuf/duration.rb | 98 ++ .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++++ .../proto_docs/google/protobuf/timestamp.rb | 127 ++ .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + .../snippets/cloud_scheduler/create_job.rb | 42 + .../snippets/cloud_scheduler/delete_job.rb | 42 + .../snippets/cloud_scheduler/get_job.rb | 42 + .../snippets/cloud_scheduler/list_jobs.rb | 46 + .../snippets/cloud_scheduler/pause_job.rb | 42 + .../snippets/cloud_scheduler/resume_job.rb | 42 + .../snippets/cloud_scheduler/run_job.rb | 42 + .../snippets/cloud_scheduler/update_job.rb | 42 + ...et_metadata_google.cloud.scheduler.v1.json | 335 +++++ .../v1/cloud_scheduler_paths_test.rb | 61 + .../scheduler/v1/cloud_scheduler_rest_test.rb | 518 ++++++++ .../scheduler/v1/cloud_scheduler_test.rb | 544 ++++++++ .../google-cloud-scheduler-v1/test/helper.rb | 25 + 56 files changed, 8495 insertions(+) create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb create mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.gitignore b/owl-bot-staging/google-cloud-scheduler-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-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-scheduler-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json new file mode 100644 index 000000000000..fd620042e2d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudscheduler.googleapis.com", + "api_shortname": "cloudscheduler", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest", + "distribution_name": "google-cloud-scheduler-v1", + "is_cloud": true, + "language": "ruby", + "name": "cloudscheduler", + "name_pretty": "Cloud Scheduler V1 API", + "product_documentation": "https://cloud.google.com/scheduler", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SCHEDULER", + "ruby-cloud-product-url": "https://cloud.google.com/scheduler", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml new file mode 100644 index 000000000000..1aa300a65945 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-scheduler-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-scheduler-v1.rb" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.yardopts b/owl-bot-staging/google-cloud-scheduler-v1/.yardopts new file mode 100644 index 000000000000..dacf43e29c36 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Scheduler 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-scheduler-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..005a9dcc4843 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md @@ -0,0 +1,151 @@ +# Authentication + +In general, the google-cloud-scheduler-v1 library uses +[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) +credentials to connect to Google Cloud services. When running within +[Google Cloud Platform environments](#google-cloud-platform-environments) the +credentials will be discovered automatically. When running on other +environments, the Service Account credentials can be specified by providing the +path to the +[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) +for the account (or the JSON itself) in +[environment variables](#environment-variables). Additionally, Cloud SDK +credentials can also be discovered automatically, but this is only recommended +during development. + +## Quickstart + +1. [Create a service account and credentials](#creating-a-service-account). +2. Set the [environment variable](#environment-variables). + +```sh +export SCHEDULER_CREDENTIALS=path/to/keyfile.json +``` + +3. Initialize the client. + +```ruby +require "google/cloud/scheduler/v1" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +``` + +## Credential Lookup + +The google-cloud-scheduler-v1 library aims to make authentication +as simple as possible, and provides several mechanisms to configure your system +without requiring **Service Account Credentials** directly in code. + +**Credentials** are discovered in the following order: + +1. Specify credentials in method arguments +2. Specify credentials in configuration +3. Discover credentials path in environment variables +4. Discover credentials JSON in environment variables +5. Discover credentials file in the Cloud SDK's path +6. Discover GCP credentials + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. +Code should be written as if already authenticated. + +### Environment Variables + +The **Credentials JSON** can be placed in environment variables instead of +declaring them directly in code. Each service has its own environment variable, +allowing for different service accounts to be used for different services. (See +the READMEs for the individual service gems for details.) The path to the +**Credentials JSON** file can be stored in the environment variable, or the +**Credentials JSON** itself can be stored for environments such as Docker +containers where writing files is difficult or not encouraged. + +The environment variables that google-cloud-scheduler-v1 +checks for credentials are configured on the service Credentials class (such as +{::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials}): + +* `SCHEDULER_CREDENTIALS` - Path to JSON file, or JSON contents +* `SCHEDULER_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/scheduler/v1" + +ENV["SCHEDULER_CREDENTIALS"] = "path/to/keyfile.json" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +``` + +### Configuration + +The path to the **Credentials JSON** file can be configured instead of storing +it in an environment variable. Either on an individual client initialization: + +```ruby +require "google/cloud/scheduler/v1" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = "path/to/keyfile.json" +end +``` + +Or globally for all clients: + +```ruby +require "google/cloud/scheduler/v1" + +::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| + config.credentials = "path/to/keyfile.json" +end + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +``` + +### Cloud SDK + +This option allows for an easy way to authenticate during development. If +credentials are not provided in code or in environment variables, then Cloud SDK +credentials are discovered. + +To configure your system for this, simply: + +1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) +2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` +3. Write code as if already authenticated. + +**NOTE:** This is _not_ recommended for running in production. The Cloud SDK +*should* only be used during development. + +## Creating a Service Account + +Google Cloud requires **Service Account Credentials** to +connect to the APIs. You will use the **JSON key file** to +connect to most services with google-cloud-scheduler-v1. + +If you are not running this client within +[Google Cloud Platform environments](#google-cloud-platform-environments), you +need a Google Developers service account. + +1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). +2. Create a new project or click on an existing project. +3. Activate the menu in the upper left and select **APIs & Services**. From + here, you will enable the APIs that your application requires. + + *Note: You may need to enable billing in order to use these services.* + +4. Select **Credentials** from the side navigation. + + Find the "Create credentials" drop down near the top of the page, and select + "Service account" to be guided through downloading a new JSON key file. + + If you want to re-use an existing service account, you can easily generate a + new key file. Just select the account you wish to re-use, click the pencil + tool on the right side to edit the service account, select the **Keys** tab, + and then select **Add Key**. + + The key file you download will be used by this library to authenticate API + requests and should be stored in a secure location. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile new file mode 100644 index 000000000000..b4e2a20bb606 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gemspec diff --git a/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md b/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-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-scheduler-v1/README.md b/owl-bot-staging/google-cloud-scheduler-v1/README.md new file mode 100644 index 000000000000..bef19f1926f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Cloud Scheduler V1 API + +Creates and manages jobs run on a regular recurring schedule. + +Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. + +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 Scheduler V1 API. Most users should consider using +the main client gem, +[google-cloud-scheduler](https://rubygems.org/gems/google-cloud-scheduler). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-scheduler-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/cloudscheduler.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/scheduler/v1" + +client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...) +response = client.list_jobs request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/scheduler) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-scheduler`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-scheduler-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-scheduler`. +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-scheduler-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-scheduler-v1/Rakefile b/owl-bot-staging/google-cloud-scheduler-v1/Rakefile new file mode 100644 index 000000000000..469b9c1395ea --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-scheduler-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-scheduler-v1" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +end + +# Acceptance tests +desc "Run the google-cloud-scheduler-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SCHEDULER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SCHEDULER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SCHEDULER_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 SCHEDULER_TEST_PROJECT=test123 SCHEDULER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/scheduler/v1/cloud_scheduler/credentials" + ::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SCHEDULER_PROJECT"] = project + ENV["SCHEDULER_TEST_PROJECT"] = project + ENV["SCHEDULER_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-scheduler-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance tests with coverage." + task :coverage do + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-scheduler-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-scheduler-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-scheduler-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-scheduler-v1" + header "google-cloud-scheduler-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-scheduler-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-scheduler-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-scheduler-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-scheduler-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-scheduler-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json new file mode 100644 index 000000000000..df9b4bb49562 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.scheduler.v1", + "libraryPackage": "::Google::Cloud::Scheduler::V1", + "services": { + "CloudScheduler": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client", + "rpcs": { + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "PauseJob": { + "methods": [ + "pause_job" + ] + }, + "ResumeJob": { + "methods": [ + "resume_job" + ] + }, + "RunJob": { + "methods": [ + "run_job" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec b/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec new file mode 100644 index 000000000000..4eae157d5703 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec @@ -0,0 +1,38 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/scheduler/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-scheduler-v1" + gem.version = Google::Cloud::Scheduler::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details." + gem.summary = "Creates and manages jobs run on a regular recurring schedule." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.3" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.18" + gem.add_development_dependency "yard", "~> 0.9" +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb new file mode 100644 index 000000000000..778ff8737f36 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/scheduler/v1" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb new file mode 100644 index 000000000000..c675c91c6e09 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1/cloud_scheduler" +require "google/cloud/scheduler/v1/version" + +module Google + module Cloud + module Scheduler + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/scheduler/v1" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/scheduler/v1" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/scheduler/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb new file mode 100644 index 000000000000..66d3521e1353 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module Scheduler + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/scheduler/v1/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = Configuration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + + ## + # @private + # Configuration class for the google.cloud.scheduler.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.scheduler.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb new file mode 100644 index 000000000000..437a054696b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See 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/scheduler/v1/version" + +require "google/cloud/scheduler/v1/cloud_scheduler/credentials" +require "google/cloud/scheduler/v1/cloud_scheduler/paths" +require "google/cloud/scheduler/v1/cloud_scheduler/client" +require "google/cloud/scheduler/v1/cloud_scheduler/rest" + +module Google + module Cloud + module Scheduler + module V1 + ## + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/scheduler/v1/cloud_scheduler" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/scheduler/v1/cloud_scheduler/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module CloudScheduler + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_scheduler", "helpers.rb" +require "google/cloud/scheduler/v1/cloud_scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb new file mode 100644 index 000000000000..dafd84ab9851 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb @@ -0,0 +1,1154 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/location" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + ## + # Client for the CloudScheduler service. + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + class Client + include Paths + + # @private + attr_reader :cloud_scheduler_stub + + ## + # Configure the CloudScheduler Client class. + # + # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudScheduler clients + # ::Google::Cloud::Scheduler::V1::CloudScheduler::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", "Scheduler", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 600.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_job.timeout = 600.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_job.timeout = 600.0 + + default_config.rpcs.update_job.timeout = 600.0 + + default_config.rpcs.delete_job.timeout = 600.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.pause_job.timeout = 600.0 + + default_config.rpcs.resume_job.timeout = 600.0 + + default_config.rpcs.run_job.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudScheduler 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::Scheduler::V1::CloudScheduler::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 + + ## + # Create a new CloudScheduler client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudScheduler client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/scheduler/v1/cloudscheduler_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 == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @cloud_scheduler_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Scheduler::V1::CloudScheduler::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Lists jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @param page_token [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. It is an + # error to switch the value of + # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + # iterating through pages. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1::Job#name name}. + # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :create_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a job. + # + # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the job are being updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job&.name + header_params["job.name"] = request.job.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. The state + # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if + # paused it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must + # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to + # be paused. + # + # @overload pause_job(request, options = nil) + # Pass arguments to `pause_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_job(name: nil) + # Pass arguments to `pause_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + # + # # Call the pause_job method. + # result = client.pause_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def pause_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.pause_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.pause_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :pause_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a job. + # + # This method reenables a job after it has been + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state + # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; + # after calling this method it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job + # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} + # to be resumed. + # + # @overload resume_job(request, options = nil) + # Pass arguments to `resume_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_job(name: nil) + # Pass arguments to `resume_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + # + # # Call the resume_job method. + # result = client.resume_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def resume_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resume_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resume_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :resume_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_job(name: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudScheduler API. + # + # This class represents the configuration for CloudScheduler, + # providing control 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::Scheduler::V1::CloudScheduler::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"cloudscheduler.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials 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] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "cloudscheduler.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + 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 + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + 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 CloudScheduler API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `pause_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_job + ## + # RPC-specific configuration for `resume_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job + @pause_job = ::Gapic::Config::Method.new pause_job_config + resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job + @resume_job = ::Gapic::Config::Method.new resume_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb new file mode 100644 index 000000000000..a396286050c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Scheduler + module V1 + module CloudScheduler + # Credentials for the CloudScheduler API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SCHEDULER_CREDENTIALS", + "SCHEDULER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SCHEDULER_CREDENTIALS_JSON", + "SCHEDULER_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-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb new file mode 100644 index 000000000000..852b28394814 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + # Path helper methods for the CloudScheduler API. + module Paths + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb new file mode 100644 index 000000000000..59559cad5b2d --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/scheduler/v1/version" +require "google/cloud/scheduler/v1/bindings_override" + +require "google/cloud/scheduler/v1/cloud_scheduler/credentials" +require "google/cloud/scheduler/v1/cloud_scheduler/paths" +require "google/cloud/scheduler/v1/cloud_scheduler/rest/client" + +module Google + module Cloud + module Scheduler + module V1 + ## + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/scheduler/v1/cloud_scheduler/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module CloudScheduler + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/scheduler/v1/cloud_scheduler/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb new file mode 100644 index 000000000000..f3b564b7576a --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb @@ -0,0 +1,1077 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + module Rest + ## + # REST client for the CloudScheduler service. + # + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + # + class Client + include Paths + + # @private + attr_reader :cloud_scheduler_stub + + ## + # Configure the CloudScheduler Client class. + # + # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudScheduler clients + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Scheduler", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_jobs.timeout = 600.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_job.timeout = 600.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_job.timeout = 600.0 + + default_config.rpcs.update_job.timeout = 600.0 + + default_config.rpcs.delete_job.timeout = 600.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.pause_job.timeout = 600.0 + + default_config.rpcs.resume_job.timeout = 600.0 + + default_config.rpcs.run_job.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudScheduler 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::Scheduler::V1::CloudScheduler::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new CloudScheduler REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudScheduler client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.bindings_override = @config.bindings_override + end + + @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Lists jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @param page_token [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#list_jobs ListJobs}. It is an + # error to switch the value of + # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + # iterating through pages. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, "jobs", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_job(parent: nil, job: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1::Job#name name}. + # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.create_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a job. + # + # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_job(job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the job are being updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(name: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.delete_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#resume_job ResumeJob}. The state + # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if + # paused it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must + # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to + # be paused. + # + # @overload pause_job(request, options = nil) + # Pass arguments to `pause_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_job(name: nil) + # Pass arguments to `pause_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + # + # # Call the pause_job method. + # result = client.pause_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def pause_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.pause_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.pause_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.pause_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a job. + # + # This method reenables a job after it has been + # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state + # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; + # after calling this method it will be set to + # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job + # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} + # to be resumed. + # + # @overload resume_job(request, options = nil) + # Pass arguments to `resume_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_job(name: nil) + # Pass arguments to `resume_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + # + # # Call the resume_job method. + # result = client.resume_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def resume_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.resume_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resume_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.resume_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_job(name: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/scheduler/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Scheduler::V1::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Google::Cloud::Scheduler::V1::Job. + # p result + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.run_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.run_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_scheduler_stub.run_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudScheduler REST API. + # + # This class represents the configuration for CloudScheduler REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_jobs to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_jobs.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"cloudscheduler.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + DEFAULT_ENDPOINT = "cloudscheduler.googleapis.com" + + config_attr :endpoint, DEFAULT_ENDPOINT, ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CloudScheduler API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `pause_job` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_job + ## + # RPC-specific configuration for `resume_job` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + + # @private + def initialize parent_rpcs = nil + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job + @pause_job = ::Gapic::Config::Method.new pause_job_config + resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job + @resume_job = ::Gapic::Config::Method.new resume_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb new file mode 100644 index 000000000000..898749723793 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb @@ -0,0 +1,525 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1/cloudscheduler_pb" + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + module Rest + ## + # REST service stub for the CloudScheduler service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def update_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the pause_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def pause_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the resume_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def resume_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the run_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Scheduler::V1::Job] + # A result object deserialized from the server's reply + def run_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{job.name}", + body: "job", + matches: [ + ["job.name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_job REST call + # + # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb new file mode 100644 index 000000000000..9f1d3ec377bf --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1/cloudscheduler.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/scheduler/v1/job_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n.google/cloud/scheduler/v1/cloudscheduler.proto\x12\x19google.cloud.scheduler.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/scheduler/v1/job.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"s\n\x0fListJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"Y\n\x10ListJobsResponse\x12,\n\x04jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.scheduler.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\rGetJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"\x7f\n\x10\x43reateJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x30\n\x03job\x18\x02 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\"u\n\x10UpdateJobRequest\x12\x30\n\x03job\x18\x01 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x10\x44\x65leteJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"J\n\x0fPauseJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"K\n\x10ResumeJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"H\n\rRunJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job2\xb3\n\n\x0e\x43loudScheduler\x12\x9e\x01\n\x08ListJobs\x12*.google.cloud.scheduler.v1.ListJobsRequest\x1a+.google.cloud.scheduler.v1.ListJobsResponse\"9\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\xda\x41\x06parent\x12\x8b\x01\n\x06GetJob\x12(.google.cloud.scheduler.v1.GetJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"7\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\xda\x41\x04name\x12\x9c\x01\n\tCreateJob\x12+.google.cloud.scheduler.v1.CreateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"B\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\xda\x41\nparent,job\x12\xa5\x01\n\tUpdateJob\x12+.google.cloud.scheduler.v1.UpdateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"K\x82\xd3\xe4\x93\x02\x33\x32,/v1/{job.name=projects/*/locations/*/jobs/*}:\x03job\xda\x41\x0fjob,update_mask\x12\x89\x01\n\tDeleteJob\x12+.google.cloud.scheduler.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\xda\x41\x04name\x12\x98\x01\n\x08PauseJob\x12*.google.cloud.scheduler.v1.PauseJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"@\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/jobs/*}:pause:\x01*\xda\x41\x04name\x12\x9b\x01\n\tResumeJob\x12+.google.cloud.scheduler.v1.ResumeJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"A\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:resume:\x01*\xda\x41\x04name\x12\x92\x01\n\x06RunJob\x12(.google.cloud.scheduler.v1.RunJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\">\x82\xd3\xe4\x93\x02\x31\",/v1/{name=projects/*/locations/*/jobs/*}:run:\x01*\xda\x41\x04name\x1aQ\xca\x41\x1d\x63loudscheduler.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBz\n\x1d\x63om.google.cloud.scheduler.v1B\x0eSchedulerProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xa2\x02\tSCHEDULERb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.scheduler.v1.Job", "google/cloud/scheduler/v1/job.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 Scheduler + module V1 + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsResponse").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.GetJobRequest").msgclass + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.CreateJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.UpdateJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.DeleteJobRequest").msgclass + PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PauseJobRequest").msgclass + ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ResumeJobRequest").msgclass + RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RunJobRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb new file mode 100644 index 000000000000..01489960c3fe --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb @@ -0,0 +1,89 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/scheduler/v1/cloudscheduler.proto for package 'google.cloud.scheduler.v1' +# Original file comments: +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/scheduler/v1/cloudscheduler_pb' + +module Google + module Cloud + module Scheduler + module V1 + module CloudScheduler + # The Cloud Scheduler API allows external entities to reliably + # schedule asynchronous jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.scheduler.v1.CloudScheduler' + + # Lists jobs. + rpc :ListJobs, ::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Google::Cloud::Scheduler::V1::ListJobsResponse + # Gets a job. + rpc :GetJob, ::Google::Cloud::Scheduler::V1::GetJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Creates a job. + rpc :CreateJob, ::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Updates a job. + # + # If successful, the updated [Job][google.cloud.scheduler.v1.Job] is + # returned. If the job does not exist, `NOT_FOUND` is returned. + # + # If UpdateJob does not successfully return, it is possible for the + # job to be in an + # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] + # state. A job in this state may not be executed. If this happens, retry the + # UpdateJob request until a successful response is received. + rpc :UpdateJob, ::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Deletes a job. + rpc :DeleteJob, ::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Google::Protobuf::Empty + # Pauses a job. + # + # If a job is paused then the system will stop executing the job + # until it is re-enabled via + # [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state + # of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if + # paused it will be set to + # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must + # be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to + # be paused. + rpc :PauseJob, ::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Resume a job. + # + # This method reenables a job after it has been + # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state + # of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; + # after calling this method it will be set to + # [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job + # must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] + # to be resumed. + rpc :ResumeJob, ::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1::Job + # Forces a job to run now. + # + # When this method is called, Cloud Scheduler will dispatch the job, even + # if the job is already running. + rpc :RunJob, ::Google::Cloud::Scheduler::V1::RunJobRequest, ::Google::Cloud::Scheduler::V1::Job + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb new file mode 100644 index 000000000000..c5ae5cfefc15 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1/job.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/scheduler/v1/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n#google/cloud/scheduler/v1/job.proto\x12\x19google.cloud.scheduler.v1\x1a\x19google/api/resource.proto\x1a&google/cloud/scheduler/v1/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xcb\x06\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12@\n\rpubsub_target\x18\x04 \x01(\x0b\x32\'.google.cloud.scheduler.v1.PubsubTargetH\x00\x12P\n\x16\x61pp_engine_http_target\x18\x05 \x01(\x0b\x32..google.cloud.scheduler.v1.AppEngineHttpTargetH\x00\x12<\n\x0bhttp_target\x18\x06 \x01(\x0b\x32%.google.cloud.scheduler.v1.HttpTargetH\x00\x12\x10\n\x08schedule\x18\x14 \x01(\t\x12\x11\n\ttime_zone\x18\x15 \x01(\t\x12\x34\n\x10user_update_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x05state\x18\n \x01(\x0e\x32$.google.cloud.scheduler.v1.Job.State\x12\"\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.Status\x12\x31\n\rschedule_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11last_attempt_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x0cretry_config\x18\x13 \x01(\x0b\x32&.google.cloud.scheduler.v1.RetryConfig\x12\x33\n\x10\x61ttempt_deadline\x18\x16 \x01(\x0b\x32\x19.google.protobuf.Duration\"X\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x11\n\rUPDATE_FAILED\x10\x04:Z\xea\x41W\n!cloudscheduler.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}B\x08\n\x06target\"\xe2\x01\n\x0bRetryConfig\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14min_backoff_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14max_backoff_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\x42h\n\x1d\x63om.google.cloud.scheduler.v1B\x08JobProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.scheduler.v1.PubsubTarget", "google/cloud/scheduler/v1/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Scheduler + module V1 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job").msgclass + Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job.State").enummodule + RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RetryConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb new file mode 100644 index 000000000000..989f1cd59a32 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/scheduler/v1/cloud_scheduler/rest" +require "google/cloud/scheduler/v1/bindings_override" +require "google/cloud/scheduler/v1/version" + +module Google + module Cloud + module Scheduler + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/scheduler/v1/rest" + # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb new file mode 100644 index 000000000000..1f9e5b08baa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/scheduler/v1/target.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' + + +descriptor_data = "\n&google/cloud/scheduler/v1/target.proto\x12\x19google.cloud.scheduler.v1\x1a\x19google/api/resource.proto\"\xea\x02\n\nHttpTarget\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12:\n\x0bhttp_method\x18\x02 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12\x43\n\x07headers\x18\x03 \x03(\x0b\x32\x32.google.cloud.scheduler.v1.HttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12<\n\x0boauth_token\x18\x05 \x01(\x0b\x32%.google.cloud.scheduler.v1.OAuthTokenH\x00\x12:\n\noidc_token\x18\x06 \x01(\x0b\x32$.google.cloud.scheduler.v1.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xbc\x02\n\x13\x41ppEngineHttpTarget\x12:\n\x0bhttp_method\x18\x01 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12G\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32+.google.cloud.scheduler.v1.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12L\n\x07headers\x18\x04 \x03(\x0b\x32;.google.cloud.scheduler.v1.AppEngineHttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd2\x01\n\x0cPubsubTarget\x12\x34\n\ntopic_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12K\n\nattributes\x18\x04 \x03(\x0b\x32\x37.google.cloud.scheduler.v1.PubsubTarget.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42\xae\x01\n\x1d\x63om.google.cloud.scheduler.v1B\x0bTargetProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError => e + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Scheduler + module V1 + HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpTarget").msgclass + AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineHttpTarget").msgclass + PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PubsubTarget").msgclass + AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineRouting").msgclass + OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OAuthToken").msgclass + OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OidcToken").msgclass + HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb new file mode 100644 index 000000000000..4894d2b441b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Scheduler + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md new file mode 100644 index 000000000000..3bc7344421da --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Scheduler 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-scheduler-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..77056d6d22a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb @@ -0,0 +1,381 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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 + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + 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-scheduler-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..843c8e9deea2 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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-scheduler-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..173c5c85f5dc --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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-scheduler-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..522e181c4702 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same + # concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb new file mode 100644 index 000000000000..edff18c2d162 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Scheduler + module V1 + # Request message for listing jobs using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. + # + # The maximum page size is 500. If unspecified, the page size will + # be the maximum. Fewer jobs than requested might be returned, + # even if more jobs exist; use next_page_token to determine if more + # jobs exist. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server will return. To + # request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. It is an + # error to switch the value of + # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or + # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while + # iterating through pages. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing jobs using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Scheduler::V1::Job>] + # The list of jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Pass this value in the + # {::Google::Cloud::Scheduler::V1::ListJobsRequest#page_token page_token} field in + # the subsequent call to + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs} to retrieve + # the next page of results. If this is empty it indicates that there are no + # more results through which to paginate. + # + # The page token is valid for only 2 hours. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job GetJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID`. + # @!attribute [rw] job + # @return [::Google::Cloud::Scheduler::V1::Job] + # Required. The job to add. The user can optionally specify a name for the + # job in {::Google::Cloud::Scheduler::V1::Job#name name}. + # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an + # existing job. If a name is not specified then the system will + # generate a random unique name that will be returned + # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. + # @!attribute [rw] job + # @return [::Google::Cloud::Scheduler::V1::Job] + # Required. The new job properties. + # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. + # + # Output only fields cannot be modified using UpdateJob. + # Any value specified for an output only field will be ignored. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask used to specify which fields of the job are being updated. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a job using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job DeleteJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job PauseJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class PauseJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class ResumeJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for forcing a job to run now using + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job RunJob}. + # @!attribute [rw] name + # @return [::String] + # Required. The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + class RunJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb new file mode 100644 index 000000000000..c74222ec1f5b --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Scheduler + module V1 + # Configuration for a job. + # The maximum allowed size for a job is 1MB. + # @!attribute [rw] name + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}, after + # which it becomes output only. + # + # The job name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the job's location. + # The list of available locations can be obtained by calling + # {::Google::Cloud::Location::Locations::Client#list_locations ListLocations}. + # For more information, see https://cloud.google.com/about/locations/. + # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), or underscores (_). The maximum length is 500 characters. + # @!attribute [rw] description + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob} or + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. + # + # A human-readable description for the job. This string must not contain + # more than 500 characters. + # @!attribute [rw] pubsub_target + # @return [::Google::Cloud::Scheduler::V1::PubsubTarget] + # Pub/Sub target. + # @!attribute [rw] app_engine_http_target + # @return [::Google::Cloud::Scheduler::V1::AppEngineHttpTarget] + # App Engine HTTP target. + # @!attribute [rw] http_target + # @return [::Google::Cloud::Scheduler::V1::HttpTarget] + # HTTP target. + # @!attribute [rw] schedule + # @return [::String] + # Required, except when used with + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. + # + # Describes the schedule on which the job will be executed. + # + # The schedule can be either of the following types: + # + # * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) + # * English-like + # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) + # + # As a general rule, execution `n + 1` of a job will not begin + # until execution `n` has finished. Cloud Scheduler will never + # allow two simultaneously outstanding executions. For example, + # this implies that if the `n+1`th execution is scheduled to run at + # 16:00 but the `n`th execution takes until 16:15, the `n+1`th + # execution will not start until `16:15`. + # A scheduled start time will be delayed if the previous + # execution has not ended when its scheduled time occurs. + # + # If {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} > 0 and + # a job attempt fails, the job will be tried a total of + # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times, + # with exponential backoff, until the next scheduled start time. + # @!attribute [rw] time_zone + # @return [::String] + # Specifies the time zone to be used in interpreting + # {::Google::Cloud::Scheduler::V1::Job#schedule schedule}. The value of this field + # must be a time zone name from the [tz + # database](http://en.wikipedia.org/wiki/Tz_database). + # + # Note that some time zones include a provision for + # daylight savings time. The rules for daylight saving time are + # determined by the chosen tz. For UTC use the string "utc". If a + # time zone is not specified, the default will be in UTC (also known + # as GMT). + # @!attribute [rw] user_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the job. + # @!attribute [rw] state + # @return [::Google::Cloud::Scheduler::V1::Job::State] + # Output only. State of the job. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Output only. The response from the target for the last attempted execution. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The next time the job is scheduled. Note that this may be a + # retry of a previously failed attempt or the next execution time + # according to the schedule. + # @!attribute [rw] last_attempt_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the last job attempt started. + # @!attribute [rw] retry_config + # @return [::Google::Cloud::Scheduler::V1::RetryConfig] + # Settings that determine the retry behavior. + # @!attribute [rw] attempt_deadline + # @return [::Google::Protobuf::Duration] + # The deadline for job attempts. If the request handler does not respond by + # this deadline then the request is cancelled and the attempt is marked as a + # `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in + # execution logs. Cloud Scheduler will retry the job according + # to the {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. + # + # The default and the allowed values depend on the type of target: + # + # * For {::Google::Cloud::Scheduler::V1::Job#http_target HTTP targets}, the + # default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + # minutes]. + # + # * For [App Engine HTTP + # targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates + # that the request has the default deadline. The default deadline depends on + # the scaling type of the service: 10 minutes for standard apps with + # automatic scaling, 24 hours for standard apps with manual and basic + # scaling, and 60 minutes for flex apps. If the request deadline is set, it + # must be in the interval [15 seconds, 24 hours 15 seconds]. + # + # * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this + # field is ignored. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the job. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The job is executing normally. + ENABLED = 1 + + # The job is paused by the user. It will not execute. A user can + # intentionally pause the job using + # {::Google::Cloud::Scheduler::V1::PauseJobRequest PauseJobRequest}. + PAUSED = 2 + + # The job is disabled by the system due to error. The user + # cannot directly set a job to be disabled. + DISABLED = 3 + + # The job state resulting from a failed + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} + # operation. To recover a job from this state, retry + # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} + # until a successful response is received. + UPDATE_FAILED = 4 + end + end + + # Settings that determine the retry behavior. + # + # By default, if a job does not complete successfully (meaning that + # an acknowledgement is not received from the handler, then it will be retried + # with exponential backoff according to the settings in + # {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. + # @!attribute [rw] retry_count + # @return [::Integer] + # The number of attempts that the system will make to run a job using the + # exponential backoff procedure described by + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_doublings max_doublings}. + # + # The default value of retry_count is zero. + # + # If retry_count is zero, a job attempt will *not* be retried if + # it fails. Instead the Cloud Scheduler system will wait for the + # next scheduled execution time. + # + # If retry_count is set to a non-zero number then Cloud Scheduler + # will retry failed attempts, using exponential backoff, + # retry_count times, or until the next scheduled execution time, + # whichever comes first. + # + # Values greater than 5 and negative values are not allowed. + # @!attribute [rw] max_retry_duration + # @return [::Google::Protobuf::Duration] + # The time limit for retrying a failed job, measured from time when an + # execution was first attempted. If specified with + # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count}, the job + # will be retried until both limits are reached. + # + # The default value for max_retry_duration is zero, which means retry + # duration is unlimited. + # @!attribute [rw] min_backoff_duration + # @return [::Google::Protobuf::Duration] + # The minimum amount of time to wait before retrying a job after + # it fails. + # + # The default value of this field is 5 seconds. + # @!attribute [rw] max_backoff_duration + # @return [::Google::Protobuf::Duration] + # The maximum amount of time to wait before retrying a job after + # it fails. + # + # The default value of this field is 1 hour. + # @!attribute [rw] max_doublings + # @return [::Integer] + # The time between retries will double `max_doublings` times. + # + # A job's retry interval starts at + # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration}, + # then doubles `max_doublings` times, then increases linearly, and finally + # retries at intervals of + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} + # up to {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} + # times. + # + # For example, if + # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration} + # is 10s, + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} + # is 300s, and `max_doublings` is 3, then the a job will first be retried in + # 10s. The retry interval will double three times, and then increase linearly + # by 2^3 * 10s. Finally, the job will retry at intervals of + # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} + # until the job has been attempted + # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times. + # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + # 300s, .... + # + # The default value of this field is 5. + class RetryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb new file mode 100644 index 000000000000..3ba68d9f0837 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb @@ -0,0 +1,403 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Scheduler + module V1 + # Http target. The job will be pushed to the job handler by means of + # an HTTP request via an + # {::Google::Cloud::Scheduler::V1::HttpTarget#http_method http_method} such as HTTP + # POST, HTTP GET, etc. The job is acknowledged by means of an HTTP + # response code in the range [200 - 299]. A failure to receive a response + # constitutes a failed execution. For a redirected request, the response + # returned by the redirected request is considered. + # @!attribute [rw] uri + # @return [::String] + # Required. The full URI path that the request will be sent to. This string + # must begin with either "http://" or "https://". Some examples of + # valid values for {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri} are: + # `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will + # encode some characters for safety and compatibility. The maximum allowed + # URL length is 2083 characters after encoding. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Scheduler::V1::HttpMethod] + # Which HTTP method to use for the request. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # The user can specify HTTP request headers to send with the job's + # HTTP request. This map contains the header field names and + # values. Repeated headers are not supported, but a header value can + # contain commas. These headers represent a subset of the headers + # that will accompany the job's HTTP request. Some HTTP request + # headers will be ignored or replaced. A partial list of headers that + # will be ignored or replaced is below: + # - Host: This will be computed by Cloud Scheduler and derived from + # {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri}. + # * `Content-Length`: This will be computed by Cloud Scheduler. + # * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. + # * `X-Google-*`: Google internal use only. + # * `X-AppEngine-*`: Google internal use only. + # * `X-CloudScheduler`: This header will be set to true. + # * `X-CloudScheduler-JobName`: This header will contain the job name. + # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. + # + # The total size of headers must be less than 80KB. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. A request body is allowed only if the HTTP + # method is POST, PUT, or PATCH. It is an error to set body on a job with an + # incompatible {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Scheduler::V1::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Scheduler::V1::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + class HttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine target. The job will be pushed to a job handler by means + # of an HTTP request via an + # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#http_method http_method} such + # as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an + # HTTP response code in the range [200 - 299]. Error 503 is + # considered an App Engine system error instead of an application + # error. Requests returning error 503 will be retried regardless of + # retry configuration and not counted against retry counts. Any other + # response code, or a failure to receive a response before the + # deadline, constitutes a failed attempt. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Scheduler::V1::HttpMethod] + # The HTTP method to use for the request. PATCH and OPTIONS are not + # permitted. + # @!attribute [rw] app_engine_routing + # @return [::Google::Cloud::Scheduler::V1::AppEngineRouting] + # App Engine Routing setting for the job. + # @!attribute [rw] relative_uri + # @return [::String] + # The relative URI. + # + # The relative URL must begin with "/" and must be a valid HTTP relative URL. + # It can contain a path, query string arguments, and `#` fragments. + # If the relative URL is empty, then the root path "/" will be used. + # No spaces are allowed, and the maximum length allowed is 2083 characters. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. Headers can be set + # when the job is created. + # + # Cloud Scheduler sets some headers to default values: + # + # * `User-Agent`: By default, this header is + # `"AppEngine-Google; (+http://code.google.com/appengine)"`. + # This header can be modified, but Cloud Scheduler will append + # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + # modified `User-Agent`. + # * `X-CloudScheduler`: This header will be set to true. + # * `X-CloudScheduler-JobName`: This header will contain the job name. + # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. + # + # If the job has an + # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#body body}, Cloud Scheduler + # sets the following headers: + # + # * `Content-Type`: By default, the `Content-Type` header is set to + # `"application/octet-stream"`. The default can be overridden by explictly + # setting `Content-Type` to a particular media type when the job is + # created. + # For example, `Content-Type` can be set to `"application/json"`. + # * `Content-Length`: This is computed by Cloud Scheduler. This value is + # output only. It cannot be changed. + # + # The headers below are output only. They cannot be set or overridden: + # + # * `X-Google-*`: For Google internal use only. + # * `X-AppEngine-*`: For Google internal use only. + # + # In addition, some App Engine headers, which contain + # job-specific information, are also be sent to the job handler. + # @!attribute [rw] body + # @return [::String] + # Body. + # + # HTTP request body. A request body is allowed only if the HTTP method is + # POST or PUT. It will result in invalid argument error to set a body on a + # job with an incompatible + # {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. + class AppEngineHttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Pub/Sub target. The job will be delivered by publishing a message to + # the given Pub/Sub topic. + # @!attribute [rw] topic_name + # @return [::String] + # Required. The name of the Cloud Pub/Sub topic to which messages will + # be published when a job is delivered. The topic name must be in the + # same format as required by Pub/Sub's + # [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), + # for example `projects/PROJECT_ID/topics/TOPIC_ID`. + # + # The topic must be in the same project as the Cloud Scheduler job. + # @!attribute [rw] data + # @return [::String] + # The message payload for PubsubMessage. + # + # Pubsub message must contain either non-empty data, or at least one + # attribute. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attributes for PubsubMessage. + # + # Pubsub message must contain either non-empty data, or at least one + # attribute. + class PubsubTarget + 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 + + # App Engine Routing. + # + # For more information about services, versions, and instances see + # [An Overview of App + # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), + # [Microservices Architecture on Google App + # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] service + # @return [::String] + # App service. + # + # By default, the job is sent to the service which is the default + # service when the job is attempted. + # @!attribute [rw] version + # @return [::String] + # App version. + # + # By default, the job is sent to the version which is the default + # version when the job is attempted. + # @!attribute [rw] instance + # @return [::String] + # App instance. + # + # By default, the job is sent to an instance which is available when + # the job is attempted. + # + # Requests can only be sent to a specific instance if + # [manual scaling is used in App Engine + # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). + # App Engine Flex does not support instances. For more information, see + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] host + # @return [::String] + # Output only. The host that the job is sent to. + # + # For more information about how App Engine requests are routed, see + # [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + # + # The host is constructed as: + # + # + # * `host = [application_domain_name]`
+ # `| [service] + '.' + [application_domain_name]`
+ # `| [version] + '.' + [application_domain_name]`
+ # `| [version_dot_service]+ '.' + [application_domain_name]`
+ # `| [instance] + '.' + [application_domain_name]`
+ # `| [instance_dot_service] + '.' + [application_domain_name]`
+ # `| [instance_dot_version] + '.' + [application_domain_name]`
+ # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + # + # * `application_domain_name` = The domain name of the app, for + # example .appspot.com, which is associated with the + # job's project ID. + # + # * `service =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # * `version =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} + # + # * `version_dot_service =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # * `instance =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} + # + # * `instance_dot_service =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # * `instance_dot_version =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} + # + # * `instance_dot_version_dot_service =` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} + # + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} is empty, + # then the job will be sent to the service which is the default service when + # the job is attempted. + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} is empty, + # then the job will be sent to the version which is the default version when + # the job is attempted. + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is + # empty, then the job will be sent to an instance which is available when the + # job is attempted. + # + # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service}, + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version}, or + # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is invalid, + # then the job will be sent to the default version of the default service + # when the job is attempted. + class AppEngineRouting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). + # This type of authorization should generally only be used when calling Google + # APIs hosted on *.googleapis.com. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OAuth token. + # The service account must be within the same project as the job. The caller + # must have iam.serviceAccounts.actAs permission for the service account. + # @!attribute [rw] scope + # @return [::String] + # OAuth scope to be used for generating OAuth access token. + # If not specified, "https://www.googleapis.com/auth/cloud-platform" + # will be used. + class OAuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OIDC token. + # The service account must be within the same project as the job. The caller + # must have iam.serviceAccounts.actAs permission for the service account. + # @!attribute [rw] audience + # @return [::String] + # Audience to be used when generating OIDC token. If not specified, the URI + # specified in target will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The HTTP method used to execute the job. + module HttpMethod + # HTTP method unspecified. Defaults to POST. + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST + POST = 1 + + # HTTP GET + GET = 2 + + # HTTP HEAD + HEAD = 3 + + # HTTP PUT + PUT = 4 + + # HTTP DELETE + DELETE = 5 + + # HTTP PATCH + PATCH = 6 + + # HTTP OPTIONS + OPTIONS = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..629894f93777 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b4a53d0ac67f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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-scheduler-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..4c0ad96e8eb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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-scheduler-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..c437e42a7581 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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-scheduler-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..b7de80e5ed7f --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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-scheduler-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..6f72e88c418d --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile new file mode 100644 index 000000000000..219dfdb755af --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-scheduler-v1", path: "../" +else + gem "google-cloud-scheduler-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-scheduler-v1/snippets/cloud_scheduler/create_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb new file mode 100644 index 000000000000..3c45a3dc7804 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the create_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job. It may +# require modification in order to execute successfully. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb new file mode 100644 index 000000000000..7b67f1e7dc28 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the delete_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job. It may +# require modification in order to execute successfully. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb new file mode 100644 index 000000000000..108c43998670 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the get_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job. It may require +# modification in order to execute successfully. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb new file mode 100644 index 000000000000..bcfa1a448aba --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the list_jobs call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs. It may require +# modification in order to execute successfully. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + p item + end +end +# [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb new file mode 100644 index 000000000000..c9d0b84ce1e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the pause_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job. It may require +# modification in order to execute successfully. +# +def pause_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + + # Call the pause_job method. + result = client.pause_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb new file mode 100644 index 000000000000..0d184a92e215 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the resume_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job. It may +# require modification in order to execute successfully. +# +def resume_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + + # Call the resume_job method. + result = client.resume_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb new file mode 100644 index 000000000000..ab8c7d81d122 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the run_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job. It may require +# modification in order to execute successfully. +# +def run_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::RunJobRequest.new + + # Call the run_job method. + result = client.run_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb new file mode 100644 index 000000000000..e574b8f5f4fa --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] +require "google/cloud/scheduler/v1" + +## +# Snippet for the update_job call in the CloudScheduler service +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job. It may +# require modification in order to execute successfully. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end +# [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json b/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json new file mode 100644 index 000000000000..e99f67432a10 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json @@ -0,0 +1,335 @@ +{ + "client_library": { + "name": "google-cloud-scheduler-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.scheduler.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync", + "title": "Snippet for the list_jobs call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::ListJobsResponse", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.ListJobs", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_GetJob_sync", + "title": "Snippet for the get_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.GetJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync", + "title": "Snippet for the create_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.CreateJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync", + "title": "Snippet for the update_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.UpdateJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync", + "title": "Snippet for the delete_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.DeleteJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync", + "title": "Snippet for the pause_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/pause_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::PauseJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "PauseJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.PauseJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync", + "title": "Snippet for the resume_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/resume_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::ResumeJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "ResumeJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.ResumeJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudscheduler_v1_generated_CloudScheduler_RunJob_sync", + "title": "Snippet for the run_job call in the CloudScheduler service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job. It may require modification in order to execute successfully.", + "file": "cloud_scheduler/run_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_job", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Scheduler::V1::RunJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Scheduler::V1::Job", + "client": { + "short_name": "CloudScheduler::Client", + "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" + }, + "method": { + "short_name": "RunJob", + "full_name": "google.cloud.scheduler.v1.CloudScheduler.RunJob", + "service": { + "short_name": "CloudScheduler", + "full_name": "google.cloud.scheduler.v1.CloudScheduler" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb new file mode 100644 index 000000000000..6455aac60fd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/scheduler/v1/cloud_scheduler" + +class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientPathsTest < Minitest::Test + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb new file mode 100644 index 000000000000..70047dc74c80 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb @@ -0,0 +1,518 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/scheduler/v1/cloudscheduler_pb" +require "google/cloud/scheduler/v1/cloud_scheduler/rest" + + +class ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job: job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_update_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_count + end + end + end + + def test_pause_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_pause_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_job_client_stub.call_count + end + end + end + + def test_resume_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_resume_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_job_client_stub.call_count + end + end + end + + def test_run_job + # Create test objects. + client_result = ::Google::Cloud::Scheduler::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + run_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_run_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_job_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + Gapic::Rest::ClientStub.stub :new, nil do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb new file mode 100644 index 000000000000..a2826fcabf59 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb @@ -0,0 +1,544 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/scheduler/v1/cloudscheduler_pb" +require "google/cloud/scheduler/v1/cloudscheduler_services_pb" +require "google/cloud/scheduler/v1/cloud_scheduler" + +class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Scheduler::V1::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_jobs parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_job job: job, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::DeleteJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_pause_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::PauseJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, pause_job_client_stub.call_rpc_count + end + end + + def test_resume_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::ResumeJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, resume_job_client_stub.call_rpc_count + end + end + + def test_run_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Scheduler::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_job, name + assert_kind_of ::Google::Cloud::Scheduler::V1::RunJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_job_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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::Scheduler::V1::CloudScheduler::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb new file mode 100644 index 000000000000..8f4f6cf3de22 --- /dev/null +++ b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" From 412ab48fca15de8d279b76c17a0352227aaa9484 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 8 Nov 2023 23:55:29 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google/cloud/scheduler/v1/target.rb | 8 +- .../google-cloud-scheduler-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-scheduler-v1/.rubocop.yml | 33 - .../google-cloud-scheduler-v1/.yardopts | 12 - .../AUTHENTICATION.md | 151 --- .../google-cloud-scheduler-v1/CHANGELOG.md | 2 - .../google-cloud-scheduler-v1/Gemfile | 3 - .../google-cloud-scheduler-v1/LICENSE.md | 201 --- .../google-cloud-scheduler-v1/README.md | 144 -- .../google-cloud-scheduler-v1/Rakefile | 201 --- .../gapic_metadata.json | 58 - .../google-cloud-scheduler-v1.gemspec | 38 - .../lib/google-cloud-scheduler-v1.rb | 21 - .../lib/google/cloud/scheduler/v1.rb | 45 - .../cloud/scheduler/v1/bindings_override.rb | 102 -- .../cloud/scheduler/v1/cloud_scheduler.rb | 56 - .../scheduler/v1/cloud_scheduler/client.rb | 1154 ----------------- .../v1/cloud_scheduler/credentials.rb | 51 - .../scheduler/v1/cloud_scheduler/paths.rb | 86 -- .../scheduler/v1/cloud_scheduler/rest.rb | 54 - .../v1/cloud_scheduler/rest/client.rb | 1077 --------------- .../v1/cloud_scheduler/rest/service_stub.rb | 525 -------- .../cloud/scheduler/v1/cloudscheduler_pb.rb | 60 - .../v1/cloudscheduler_services_pb.rb | 89 -- .../lib/google/cloud/scheduler/v1/job_pb.rb | 54 - .../lib/google/cloud/scheduler/v1/rest.rb | 38 - .../google/cloud/scheduler/v1/target_pb.rb | 50 - .../lib/google/cloud/scheduler/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 381 ------ .../proto_docs/google/api/field_behavior.rb | 85 -- .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 222 ---- .../cloud/scheduler/v1/cloudscheduler.rb | 168 --- .../google/cloud/scheduler/v1/job.rb | 253 ---- .../google/cloud/scheduler/v1/target.rb | 403 ------ .../proto_docs/google/protobuf/any.rb | 144 -- .../proto_docs/google/protobuf/duration.rb | 98 -- .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 ---- .../proto_docs/google/protobuf/timestamp.rb | 127 -- .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - .../snippets/cloud_scheduler/create_job.rb | 42 - .../snippets/cloud_scheduler/delete_job.rb | 42 - .../snippets/cloud_scheduler/get_job.rb | 42 - .../snippets/cloud_scheduler/list_jobs.rb | 46 - .../snippets/cloud_scheduler/pause_job.rb | 42 - .../snippets/cloud_scheduler/resume_job.rb | 42 - .../snippets/cloud_scheduler/run_job.rb | 42 - .../snippets/cloud_scheduler/update_job.rb | 42 - ...et_metadata_google.cloud.scheduler.v1.json | 335 ----- .../v1/cloud_scheduler_paths_test.rb | 61 - .../scheduler/v1/cloud_scheduler_rest_test.rb | 518 -------- .../scheduler/v1/cloud_scheduler_test.rb | 544 -------- .../google-cloud-scheduler-v1/test/helper.rb | 25 - 57 files changed, 4 insertions(+), 8499 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb delete mode 100644 owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb diff --git a/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb b/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb index 0abc738d910f..4a4fcd28f2fe 100644 --- a/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb +++ b/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb @@ -57,8 +57,8 @@ module V1 # * `X-CloudScheduler`: This header will be set to true. # * `X-CloudScheduler-JobName`: This header will contain the job name. # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule time in - # RFC3339 UTC "Zulu" format. + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. # # The total size of headers must be less than 80KB. # @!attribute [rw] body @@ -141,8 +141,8 @@ class HeadersEntry # * `X-CloudScheduler`: This header will be set to true. # * `X-CloudScheduler-JobName`: This header will contain the job name. # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule time in - # RFC3339 UTC "Zulu" format. + # the unix-cron format, this header will contain the job schedule as an + # offset of UTC parsed according to RFC3339. # # If the job has an # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#body body}, Cloud Scheduler diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.gitignore b/owl-bot-staging/google-cloud-scheduler-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-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-scheduler-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json deleted file mode 100644 index fd620042e2d3..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudscheduler.googleapis.com", - "api_shortname": "cloudscheduler", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest", - "distribution_name": "google-cloud-scheduler-v1", - "is_cloud": true, - "language": "ruby", - "name": "cloudscheduler", - "name_pretty": "Cloud Scheduler V1 API", - "product_documentation": "https://cloud.google.com/scheduler", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SCHEDULER", - "ruby-cloud-product-url": "https://cloud.google.com/scheduler", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml b/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml deleted file mode 100644 index 1aa300a65945..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-scheduler-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-scheduler-v1.rb" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/.yardopts b/owl-bot-staging/google-cloud-scheduler-v1/.yardopts deleted file mode 100644 index dacf43e29c36..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Scheduler 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-scheduler-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md deleted file mode 100644 index 005a9dcc4843..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/AUTHENTICATION.md +++ /dev/null @@ -1,151 +0,0 @@ -# Authentication - -In general, the google-cloud-scheduler-v1 library uses -[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within -[Google Cloud Platform environments](#google-cloud-platform-environments) the -credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the -[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) -for the account (or the JSON itself) in -[environment variables](#environment-variables). Additionally, Cloud SDK -credentials can also be discovered automatically, but this is only recommended -during development. - -## Quickstart - -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). - -```sh -export SCHEDULER_CREDENTIALS=path/to/keyfile.json -``` - -3. Initialize the client. - -```ruby -require "google/cloud/scheduler/v1" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -``` - -## Credential Lookup - -The google-cloud-scheduler-v1 library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without requiring **Service Account Credentials** directly in code. - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCP credentials - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. -Code should be written as if already authenticated. - -### Environment Variables - -The **Credentials JSON** can be placed in environment variables instead of -declaring them directly in code. Each service has its own environment variable, -allowing for different service accounts to be used for different services. (See -the READMEs for the individual service gems for details.) The path to the -**Credentials JSON** file can be stored in the environment variable, or the -**Credentials JSON** itself can be stored for environments such as Docker -containers where writing files is difficult or not encouraged. - -The environment variables that google-cloud-scheduler-v1 -checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials}): - -* `SCHEDULER_CREDENTIALS` - Path to JSON file, or JSON contents -* `SCHEDULER_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/scheduler/v1" - -ENV["SCHEDULER_CREDENTIALS"] = "path/to/keyfile.json" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -``` - -### Configuration - -The path to the **Credentials JSON** file can be configured instead of storing -it in an environment variable. Either on an individual client initialization: - -```ruby -require "google/cloud/scheduler/v1" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = "path/to/keyfile.json" -end -``` - -Or globally for all clients: - -```ruby -require "google/cloud/scheduler/v1" - -::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| - config.credentials = "path/to/keyfile.json" -end - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -``` - -### Cloud SDK - -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. - -To configure your system for this, simply: - -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` -3. Write code as if already authenticated. - -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. - -## Creating a Service Account - -Google Cloud requires **Service Account Credentials** to -connect to the APIs. You will use the **JSON key file** to -connect to most services with google-cloud-scheduler-v1. - -If you are not running this client within -[Google Cloud Platform environments](#google-cloud-platform-environments), you -need a Google Developers service account. - -1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). -2. Create a new project or click on an existing project. -3. Activate the menu in the upper left and select **APIs & Services**. From - here, you will enable the APIs that your application requires. - - *Note: You may need to enable billing in order to use these services.* - -4. Select **Credentials** from the side navigation. - - Find the "Create credentials" drop down near the top of the page, and select - "Service account" to be guided through downloading a new JSON key file. - - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, click the pencil - tool on the right side to edit the service account, select the **Keys** tab, - and then select **Add Key**. - - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. diff --git a/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/Gemfile deleted file mode 100644 index b4e2a20bb606..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gemspec diff --git a/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md b/owl-bot-staging/google-cloud-scheduler-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-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-scheduler-v1/README.md b/owl-bot-staging/google-cloud-scheduler-v1/README.md deleted file mode 100644 index bef19f1926f8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Ruby Client for the Cloud Scheduler V1 API - -Creates and manages jobs run on a regular recurring schedule. - -Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. - -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 Scheduler V1 API. Most users should consider using -the main client gem, -[google-cloud-scheduler](https://rubygems.org/gems/google-cloud-scheduler). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-scheduler-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/cloudscheduler.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/scheduler/v1" - -client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...) -response = client.list_jobs request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/scheduler) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-scheduler`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-scheduler-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-scheduler`. -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-scheduler-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-scheduler-v1/Rakefile b/owl-bot-staging/google-cloud-scheduler-v1/Rakefile deleted file mode 100644 index 469b9c1395ea..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/Rakefile +++ /dev/null @@ -1,201 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Runs tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-scheduler-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:test].invoke - end -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -namespace :smoke_test do - desc "Runs smoke tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-scheduler-v1" - track_files "lib/**/*.rb" - add_filter "test/" - end - - Rake::Task[:smoke_test].invoke - end -end - -# Acceptance tests -desc "Run the google-cloud-scheduler-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SCHEDULER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SCHEDULER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SCHEDULER_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 SCHEDULER_TEST_PROJECT=test123 SCHEDULER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/scheduler/v1/cloud_scheduler/credentials" - ::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SCHEDULER_PROJECT"] = project - ENV["SCHEDULER_TEST_PROJECT"] = project - ENV["SCHEDULER_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-scheduler-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance tests with coverage." - task :coverage do - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-scheduler-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-scheduler-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-scheduler-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-scheduler-v1" - header "google-cloud-scheduler-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-scheduler-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-scheduler-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-scheduler-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-scheduler-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-scheduler-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json deleted file mode 100644 index df9b4bb49562..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.scheduler.v1", - "libraryPackage": "::Google::Cloud::Scheduler::V1", - "services": { - "CloudScheduler": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client", - "rpcs": { - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "PauseJob": { - "methods": [ - "pause_job" - ] - }, - "ResumeJob": { - "methods": [ - "resume_job" - ] - }, - "RunJob": { - "methods": [ - "run_job" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec b/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec deleted file mode 100644 index 4eae157d5703..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/google-cloud-scheduler-v1.gemspec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/scheduler/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-scheduler-v1" - gem.version = Google::Cloud::Scheduler::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place. Note that google-cloud-scheduler-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-scheduler instead. See the readme for more details." - gem.summary = "Creates and manages jobs run on a regular recurring schedule." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" - - gem.add_development_dependency "google-style", "~> 1.26.3" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "rake", ">= 13.0" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.18" - gem.add_development_dependency "yard", "~> 0.9" -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb deleted file mode 100644 index 778ff8737f36..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google-cloud-scheduler-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/scheduler/v1" diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb deleted file mode 100644 index c675c91c6e09..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1/cloud_scheduler" -require "google/cloud/scheduler/v1/version" - -module Google - module Cloud - module Scheduler - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/scheduler/v1" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/scheduler/v1" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/scheduler/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb deleted file mode 100644 index 66d3521e1353..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/bindings_override.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module Scheduler - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/scheduler/v1/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Configuration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private - # Configuration class for the google.cloud.scheduler.v1 package. - # - # This class contains common configuration for all services - # of the google.cloud.scheduler.v1 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb deleted file mode 100644 index 437a054696b3..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See 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/scheduler/v1/version" - -require "google/cloud/scheduler/v1/cloud_scheduler/credentials" -require "google/cloud/scheduler/v1/cloud_scheduler/paths" -require "google/cloud/scheduler/v1/cloud_scheduler/client" -require "google/cloud/scheduler/v1/cloud_scheduler/rest" - -module Google - module Cloud - module Scheduler - module V1 - ## - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/scheduler/v1/cloud_scheduler" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/scheduler/v1/cloud_scheduler/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module CloudScheduler - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_scheduler", "helpers.rb" -require "google/cloud/scheduler/v1/cloud_scheduler/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb deleted file mode 100644 index dafd84ab9851..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb +++ /dev/null @@ -1,1154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/location" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - ## - # Client for the CloudScheduler service. - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - class Client - include Paths - - # @private - attr_reader :cloud_scheduler_stub - - ## - # Configure the CloudScheduler Client class. - # - # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudScheduler clients - # ::Google::Cloud::Scheduler::V1::CloudScheduler::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", "Scheduler", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 600.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_job.timeout = 600.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_job.timeout = 600.0 - - default_config.rpcs.update_job.timeout = 600.0 - - default_config.rpcs.delete_job.timeout = 600.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.pause_job.timeout = 600.0 - - default_config.rpcs.resume_job.timeout = 600.0 - - default_config.rpcs.run_job.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudScheduler 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::Scheduler::V1::CloudScheduler::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 - - ## - # Create a new CloudScheduler client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudScheduler client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/scheduler/v1/cloudscheduler_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 == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - end - - @cloud_scheduler_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Scheduler::V1::CloudScheduler::Stub, - credentials: credentials, - endpoint: @config.endpoint, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Lists jobs. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @param page_token [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. It is an - # error to switch the value of - # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - # iterating through pages. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1::Job#name name}. - # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :create_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a job. - # - # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the job are being updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.job&.name - header_params["job.name"] = request.job.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(name: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. The state - # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if - # paused it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must - # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to - # be paused. - # - # @overload pause_job(request, options = nil) - # Pass arguments to `pause_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_job(name: nil) - # Pass arguments to `pause_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new - # - # # Call the pause_job method. - # result = client.pause_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def pause_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.pause_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.pause_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :pause_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a job. - # - # This method reenables a job after it has been - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state - # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; - # after calling this method it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job - # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} - # to be resumed. - # - # @overload resume_job(request, options = nil) - # Pass arguments to `resume_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_job(name: nil) - # Pass arguments to `resume_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new - # - # # Call the resume_job method. - # result = client.resume_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def resume_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resume_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resume_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :resume_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - # - # @overload run_job(request, options = nil) - # Pass arguments to `run_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_job(name: nil) - # Pass arguments to `run_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::RunJobRequest.new - # - # # Call the run_job method. - # result = client.run_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def run_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.run_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.run_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudScheduler API. - # - # This class represents the configuration for CloudScheduler, - # providing control 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::Scheduler::V1::CloudScheduler::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudscheduler.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials 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] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "cloudscheduler.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - 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 - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - 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 CloudScheduler API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `pause_job` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_job - ## - # RPC-specific configuration for `resume_job` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_job - ## - # RPC-specific configuration for `run_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_job - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job - @pause_job = ::Gapic::Config::Method.new pause_job_config - resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job - @resume_job = ::Gapic::Config::Method.new resume_job_config - run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job - @run_job = ::Gapic::Config::Method.new run_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb deleted file mode 100644 index a396286050c3..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Scheduler - module V1 - module CloudScheduler - # Credentials for the CloudScheduler API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SCHEDULER_CREDENTIALS", - "SCHEDULER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SCHEDULER_CREDENTIALS_JSON", - "SCHEDULER_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-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb deleted file mode 100644 index 852b28394814..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/paths.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - # Path helper methods for the CloudScheduler API. - module Paths - ## - # Create a fully-qualified Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # - # @return [::String] - def job_path project:, location:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb deleted file mode 100644 index 59559cad5b2d..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/scheduler/v1/version" -require "google/cloud/scheduler/v1/bindings_override" - -require "google/cloud/scheduler/v1/cloud_scheduler/credentials" -require "google/cloud/scheduler/v1/cloud_scheduler/paths" -require "google/cloud/scheduler/v1/cloud_scheduler/rest/client" - -module Google - module Cloud - module Scheduler - module V1 - ## - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/scheduler/v1/cloud_scheduler/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module CloudScheduler - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/scheduler/v1/cloud_scheduler/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb deleted file mode 100644 index f3b564b7576a..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/client.rb +++ /dev/null @@ -1,1077 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - module Rest - ## - # REST client for the CloudScheduler service. - # - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - # - class Client - include Paths - - # @private - attr_reader :cloud_scheduler_stub - - ## - # Configure the CloudScheduler Client class. - # - # See {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudScheduler clients - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Scheduler", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_jobs.timeout = 600.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_job.timeout = 600.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_job.timeout = 600.0 - - default_config.rpcs.update_job.timeout = 600.0 - - default_config.rpcs.delete_job.timeout = 600.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.pause_job.timeout = 600.0 - - default_config.rpcs.resume_job.timeout = 600.0 - - default_config.rpcs.run_job.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudScheduler 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::Scheduler::V1::CloudScheduler::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # Create a new CloudScheduler REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudScheduler client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-") - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.bindings_override = @config.bindings_override - end - - @cloud_scheduler_stub = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Lists jobs. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @param page_token [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#list_jobs ListJobs}. It is an - # error to switch the value of - # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - # iterating through pages. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_scheduler_stub, :list_jobs, "jobs", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a job. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_job(parent: nil, job: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1::Job#name name}. - # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.create_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a job. - # - # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_job(job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the job are being updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::UpdateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(name: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.delete_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client#resume_job ResumeJob}. The state - # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if - # paused it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must - # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to - # be paused. - # - # @overload pause_job(request, options = nil) - # Pass arguments to `pause_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::PauseJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_job(name: nil) - # Pass arguments to `pause_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::PauseJobRequest.new - # - # # Call the pause_job method. - # result = client.pause_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def pause_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::PauseJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.pause_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.pause_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.pause_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a job. - # - # This method reenables a job after it has been - # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state - # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; - # after calling this method it will be set to - # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job - # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} - # to be resumed. - # - # @overload resume_job(request, options = nil) - # Pass arguments to `resume_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::ResumeJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_job(name: nil) - # Pass arguments to `resume_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new - # - # # Call the resume_job method. - # result = client.resume_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def resume_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::ResumeJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.resume_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resume_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.resume_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - # - # @overload run_job(request, options = nil) - # Pass arguments to `run_job` via a request object, either of type - # {::Google::Cloud::Scheduler::V1::RunJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Scheduler::V1::RunJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_job(name: nil) - # Pass arguments to `run_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/scheduler/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Scheduler::V1::RunJobRequest.new - # - # # Call the run_job method. - # result = client.run_job request - # - # # The returned object is of type Google::Cloud::Scheduler::V1::Job. - # p result - # - def run_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Scheduler::V1::RunJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.run_job.metadata.to_h - - # Set x-goog-api-client and x-goog-user-project headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Scheduler::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.run_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_scheduler_stub.run_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudScheduler REST API. - # - # This class represents the configuration for CloudScheduler REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_jobs to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_jobs.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"cloudscheduler.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - DEFAULT_ENDPOINT = "cloudscheduler.googleapis.com" - - config_attr :endpoint, DEFAULT_ENDPOINT, ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CloudScheduler API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `pause_job` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_job - ## - # RPC-specific configuration for `resume_job` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_job - ## - # RPC-specific configuration for `run_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_job - - # @private - def initialize parent_rpcs = nil - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - pause_job_config = parent_rpcs.pause_job if parent_rpcs.respond_to? :pause_job - @pause_job = ::Gapic::Config::Method.new pause_job_config - resume_job_config = parent_rpcs.resume_job if parent_rpcs.respond_to? :resume_job - @resume_job = ::Gapic::Config::Method.new resume_job_config - run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job - @run_job = ::Gapic::Config::Method.new run_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb deleted file mode 100644 index 898749723793..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloud_scheduler/rest/service_stub.rb +++ /dev/null @@ -1,525 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1/cloudscheduler_pb" - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - module Rest - ## - # REST service stub for the CloudScheduler service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def update_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the pause_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def pause_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the resume_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def resume_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the run_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Scheduler::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Scheduler::V1::Job] - # A result object deserialized from the server's reply - def run_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Scheduler::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{job.name}", - body: "job", - matches: [ - ["job.name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::PauseJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::ResumeJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_job REST call - # - # @param request_pb [::Google::Cloud::Scheduler::V1::RunJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb deleted file mode 100644 index 9f1d3ec377bf..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1/cloudscheduler.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/scheduler/v1/job_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n.google/cloud/scheduler/v1/cloudscheduler.proto\x12\x19google.cloud.scheduler.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/scheduler/v1/job.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"s\n\x0fListJobsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\"Y\n\x10ListJobsResponse\x12,\n\x04jobs\x18\x01 \x03(\x0b\x32\x1e.google.cloud.scheduler.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\rGetJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"\x7f\n\x10\x43reateJobRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!cloudscheduler.googleapis.com/Job\x12\x30\n\x03job\x18\x02 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\"u\n\x10UpdateJobRequest\x12\x30\n\x03job\x18\x01 \x01(\x0b\x32\x1e.google.cloud.scheduler.v1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x10\x44\x65leteJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"J\n\x0fPauseJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"K\n\x10ResumeJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job\"H\n\rRunJobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudscheduler.googleapis.com/Job2\xb3\n\n\x0e\x43loudScheduler\x12\x9e\x01\n\x08ListJobs\x12*.google.cloud.scheduler.v1.ListJobsRequest\x1a+.google.cloud.scheduler.v1.ListJobsResponse\"9\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\xda\x41\x06parent\x12\x8b\x01\n\x06GetJob\x12(.google.cloud.scheduler.v1.GetJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"7\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\xda\x41\x04name\x12\x9c\x01\n\tCreateJob\x12+.google.cloud.scheduler.v1.CreateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"B\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\xda\x41\nparent,job\x12\xa5\x01\n\tUpdateJob\x12+.google.cloud.scheduler.v1.UpdateJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"K\x82\xd3\xe4\x93\x02\x33\x32,/v1/{job.name=projects/*/locations/*/jobs/*}:\x03job\xda\x41\x0fjob,update_mask\x12\x89\x01\n\tDeleteJob\x12+.google.cloud.scheduler.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\xda\x41\x04name\x12\x98\x01\n\x08PauseJob\x12*.google.cloud.scheduler.v1.PauseJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"@\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/jobs/*}:pause:\x01*\xda\x41\x04name\x12\x9b\x01\n\tResumeJob\x12+.google.cloud.scheduler.v1.ResumeJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\"A\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:resume:\x01*\xda\x41\x04name\x12\x92\x01\n\x06RunJob\x12(.google.cloud.scheduler.v1.RunJobRequest\x1a\x1e.google.cloud.scheduler.v1.Job\">\x82\xd3\xe4\x93\x02\x31\",/v1/{name=projects/*/locations/*/jobs/*}:run:\x01*\xda\x41\x04name\x1aQ\xca\x41\x1d\x63loudscheduler.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBz\n\x1d\x63om.google.cloud.scheduler.v1B\x0eSchedulerProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xa2\x02\tSCHEDULERb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.scheduler.v1.Job", "google/cloud/scheduler/v1/job.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 Scheduler - module V1 - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsResponse").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.GetJobRequest").msgclass - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.CreateJobRequest").msgclass - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.UpdateJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.DeleteJobRequest").msgclass - PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PauseJobRequest").msgclass - ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ResumeJobRequest").msgclass - RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RunJobRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb deleted file mode 100644 index 01489960c3fe..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/scheduler/v1/cloudscheduler.proto for package 'google.cloud.scheduler.v1' -# Original file comments: -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/scheduler/v1/cloudscheduler_pb' - -module Google - module Cloud - module Scheduler - module V1 - module CloudScheduler - # The Cloud Scheduler API allows external entities to reliably - # schedule asynchronous jobs. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.scheduler.v1.CloudScheduler' - - # Lists jobs. - rpc :ListJobs, ::Google::Cloud::Scheduler::V1::ListJobsRequest, ::Google::Cloud::Scheduler::V1::ListJobsResponse - # Gets a job. - rpc :GetJob, ::Google::Cloud::Scheduler::V1::GetJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Creates a job. - rpc :CreateJob, ::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Updates a job. - # - # If successful, the updated [Job][google.cloud.scheduler.v1.Job] is - # returned. If the job does not exist, `NOT_FOUND` is returned. - # - # If UpdateJob does not successfully return, it is possible for the - # job to be in an - # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] - # state. A job in this state may not be executed. If this happens, retry the - # UpdateJob request until a successful response is received. - rpc :UpdateJob, ::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Deletes a job. - rpc :DeleteJob, ::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Google::Protobuf::Empty - # Pauses a job. - # - # If a job is paused then the system will stop executing the job - # until it is re-enabled via - # [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state - # of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if - # paused it will be set to - # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must - # be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to - # be paused. - rpc :PauseJob, ::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Resume a job. - # - # This method reenables a job after it has been - # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state - # of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; - # after calling this method it will be set to - # [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job - # must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] - # to be resumed. - rpc :ResumeJob, ::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1::Job - # Forces a job to run now. - # - # When this method is called, Cloud Scheduler will dispatch the job, even - # if the job is already running. - rpc :RunJob, ::Google::Cloud::Scheduler::V1::RunJobRequest, ::Google::Cloud::Scheduler::V1::Job - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb deleted file mode 100644 index c5ae5cfefc15..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/job_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1/job.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/scheduler/v1/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n#google/cloud/scheduler/v1/job.proto\x12\x19google.cloud.scheduler.v1\x1a\x19google/api/resource.proto\x1a&google/cloud/scheduler/v1/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xcb\x06\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12@\n\rpubsub_target\x18\x04 \x01(\x0b\x32\'.google.cloud.scheduler.v1.PubsubTargetH\x00\x12P\n\x16\x61pp_engine_http_target\x18\x05 \x01(\x0b\x32..google.cloud.scheduler.v1.AppEngineHttpTargetH\x00\x12<\n\x0bhttp_target\x18\x06 \x01(\x0b\x32%.google.cloud.scheduler.v1.HttpTargetH\x00\x12\x10\n\x08schedule\x18\x14 \x01(\t\x12\x11\n\ttime_zone\x18\x15 \x01(\t\x12\x34\n\x10user_update_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x05state\x18\n \x01(\x0e\x32$.google.cloud.scheduler.v1.Job.State\x12\"\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.Status\x12\x31\n\rschedule_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11last_attempt_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x0cretry_config\x18\x13 \x01(\x0b\x32&.google.cloud.scheduler.v1.RetryConfig\x12\x33\n\x10\x61ttempt_deadline\x18\x16 \x01(\x0b\x32\x19.google.protobuf.Duration\"X\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\x11\n\rUPDATE_FAILED\x10\x04:Z\xea\x41W\n!cloudscheduler.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}B\x08\n\x06target\"\xe2\x01\n\x0bRetryConfig\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14min_backoff_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14max_backoff_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\x42h\n\x1d\x63om.google.cloud.scheduler.v1B\x08JobProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.scheduler.v1.PubsubTarget", "google/cloud/scheduler/v1/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Scheduler - module V1 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job").msgclass - Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.Job.State").enummodule - RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.RetryConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb deleted file mode 100644 index 989f1cd59a32..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/scheduler/v1/cloud_scheduler/rest" -require "google/cloud/scheduler/v1/bindings_override" -require "google/cloud/scheduler/v1/version" - -module Google - module Cloud - module Scheduler - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/scheduler/v1/rest" - # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb deleted file mode 100644 index 1f9e5b08baa8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/target_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/scheduler/v1/target.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' - - -descriptor_data = "\n&google/cloud/scheduler/v1/target.proto\x12\x19google.cloud.scheduler.v1\x1a\x19google/api/resource.proto\"\xea\x02\n\nHttpTarget\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12:\n\x0bhttp_method\x18\x02 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12\x43\n\x07headers\x18\x03 \x03(\x0b\x32\x32.google.cloud.scheduler.v1.HttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12<\n\x0boauth_token\x18\x05 \x01(\x0b\x32%.google.cloud.scheduler.v1.OAuthTokenH\x00\x12:\n\noidc_token\x18\x06 \x01(\x0b\x32$.google.cloud.scheduler.v1.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xbc\x02\n\x13\x41ppEngineHttpTarget\x12:\n\x0bhttp_method\x18\x01 \x01(\x0e\x32%.google.cloud.scheduler.v1.HttpMethod\x12G\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32+.google.cloud.scheduler.v1.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12L\n\x07headers\x18\x04 \x03(\x0b\x32;.google.cloud.scheduler.v1.AppEngineHttpTarget.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd2\x01\n\x0cPubsubTarget\x12\x34\n\ntopic_name\x18\x01 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12K\n\nattributes\x18\x04 \x03(\x0b\x32\x37.google.cloud.scheduler.v1.PubsubTarget.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42\xae\x01\n\x1d\x63om.google.cloud.scheduler.v1B\x0bTargetProtoP\x01Z;cloud.google.com/go/scheduler/apiv1/schedulerpb;schedulerpb\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError => e - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Scheduler - module V1 - HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpTarget").msgclass - AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineHttpTarget").msgclass - PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PubsubTarget").msgclass - AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.AppEngineRouting").msgclass - OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OAuthToken").msgclass - OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.OidcToken").msgclass - HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.HttpMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb b/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb deleted file mode 100644 index 4894d2b441b8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/lib/google/cloud/scheduler/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md deleted file mode 100644 index 3bc7344421da..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Scheduler 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-scheduler-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 77056d6d22a8..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,381 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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 - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: - # seconds: 60 # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: - # seconds: 360 # 6 minutes - # total_poll_timeout: - # seconds: 54000 # 90 minutes - 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-scheduler-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 843c8e9deea2..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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-scheduler-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 173c5c85f5dc..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the 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-scheduler-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 522e181c4702..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same - # concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb deleted file mode 100644 index edff18c2d162..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - # Request message for listing jobs using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # - # The maximum page size is 500. If unspecified, the page size will - # be the maximum. Fewer jobs than requested might be returned, - # even if more jobs exist; use next_page_token to determine if more - # jobs exist. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server will return. To - # request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. It is an - # error to switch the value of - # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or - # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while - # iterating through pages. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing jobs using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Scheduler::V1::Job>] - # The list of jobs. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Pass this value in the - # {::Google::Cloud::Scheduler::V1::ListJobsRequest#page_token page_token} field in - # the subsequent call to - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs} to retrieve - # the next page of results. If this is empty it indicates that there are no - # more results through which to paginate. - # - # The page token is valid for only 2 hours. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job GetJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID`. - # @!attribute [rw] job - # @return [::Google::Cloud::Scheduler::V1::Job] - # Required. The job to add. The user can optionally specify a name for the - # job in {::Google::Cloud::Scheduler::V1::Job#name name}. - # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an - # existing job. If a name is not specified then the system will - # generate a random unique name that will be returned - # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response. - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. - # @!attribute [rw] job - # @return [::Google::Cloud::Scheduler::V1::Job] - # Required. The new job properties. - # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified. - # - # Output only fields cannot be modified using UpdateJob. - # Any value specified for an output only field will be ignored. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask used to specify which fields of the job are being updated. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a job using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job DeleteJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job PauseJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class PauseJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class ResumeJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for forcing a job to run now using - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job RunJob}. - # @!attribute [rw] name - # @return [::String] - # Required. The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - class RunJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb deleted file mode 100644 index c74222ec1f5b..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/job.rb +++ /dev/null @@ -1,253 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - # Configuration for a job. - # The maximum allowed size for a job is 1MB. - # @!attribute [rw] name - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob}, after - # which it becomes output only. - # - # The job name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the job's location. - # The list of available locations can be obtained by calling - # {::Google::Cloud::Location::Locations::Client#list_locations ListLocations}. - # For more information, see https://cloud.google.com/about/locations/. - # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), or underscores (_). The maximum length is 500 characters. - # @!attribute [rw] description - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job CreateJob} or - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. - # - # A human-readable description for the job. This string must not contain - # more than 500 characters. - # @!attribute [rw] pubsub_target - # @return [::Google::Cloud::Scheduler::V1::PubsubTarget] - # Pub/Sub target. - # @!attribute [rw] app_engine_http_target - # @return [::Google::Cloud::Scheduler::V1::AppEngineHttpTarget] - # App Engine HTTP target. - # @!attribute [rw] http_target - # @return [::Google::Cloud::Scheduler::V1::HttpTarget] - # HTTP target. - # @!attribute [rw] schedule - # @return [::String] - # Required, except when used with - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job UpdateJob}. - # - # Describes the schedule on which the job will be executed. - # - # The schedule can be either of the following types: - # - # * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) - # * English-like - # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) - # - # As a general rule, execution `n + 1` of a job will not begin - # until execution `n` has finished. Cloud Scheduler will never - # allow two simultaneously outstanding executions. For example, - # this implies that if the `n+1`th execution is scheduled to run at - # 16:00 but the `n`th execution takes until 16:15, the `n+1`th - # execution will not start until `16:15`. - # A scheduled start time will be delayed if the previous - # execution has not ended when its scheduled time occurs. - # - # If {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} > 0 and - # a job attempt fails, the job will be tried a total of - # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times, - # with exponential backoff, until the next scheduled start time. - # @!attribute [rw] time_zone - # @return [::String] - # Specifies the time zone to be used in interpreting - # {::Google::Cloud::Scheduler::V1::Job#schedule schedule}. The value of this field - # must be a time zone name from the [tz - # database](http://en.wikipedia.org/wiki/Tz_database). - # - # Note that some time zones include a provision for - # daylight savings time. The rules for daylight saving time are - # determined by the chosen tz. For UTC use the string "utc". If a - # time zone is not specified, the default will be in UTC (also known - # as GMT). - # @!attribute [rw] user_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the job. - # @!attribute [rw] state - # @return [::Google::Cloud::Scheduler::V1::Job::State] - # Output only. State of the job. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Output only. The response from the target for the last attempted execution. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The next time the job is scheduled. Note that this may be a - # retry of a previously failed attempt or the next execution time - # according to the schedule. - # @!attribute [rw] last_attempt_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the last job attempt started. - # @!attribute [rw] retry_config - # @return [::Google::Cloud::Scheduler::V1::RetryConfig] - # Settings that determine the retry behavior. - # @!attribute [rw] attempt_deadline - # @return [::Google::Protobuf::Duration] - # The deadline for job attempts. If the request handler does not respond by - # this deadline then the request is cancelled and the attempt is marked as a - # `DEADLINE_EXCEEDED` failure. The failed attempt can be viewed in - # execution logs. Cloud Scheduler will retry the job according - # to the {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. - # - # The default and the allowed values depend on the type of target: - # - # * For {::Google::Cloud::Scheduler::V1::Job#http_target HTTP targets}, the - # default is 3 minutes. The deadline must be in the interval [15 seconds, 30 - # minutes]. - # - # * For [App Engine HTTP - # targets][google.cloud.scheduler.v1.Job.app_engine_http_target], 0 indicates - # that the request has the default deadline. The default deadline depends on - # the scaling type of the service: 10 minutes for standard apps with - # automatic scaling, 24 hours for standard apps with manual and basic - # scaling, and 60 minutes for flex apps. If the request deadline is set, it - # must be in the interval [15 seconds, 24 hours 15 seconds]. - # - # * For [Pub/Sub targets][google.cloud.scheduler.v1.Job.pubsub_target], this - # field is ignored. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the job. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The job is executing normally. - ENABLED = 1 - - # The job is paused by the user. It will not execute. A user can - # intentionally pause the job using - # {::Google::Cloud::Scheduler::V1::PauseJobRequest PauseJobRequest}. - PAUSED = 2 - - # The job is disabled by the system due to error. The user - # cannot directly set a job to be disabled. - DISABLED = 3 - - # The job state resulting from a failed - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} - # operation. To recover a job from this state, retry - # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job CloudScheduler.UpdateJob} - # until a successful response is received. - UPDATE_FAILED = 4 - end - end - - # Settings that determine the retry behavior. - # - # By default, if a job does not complete successfully (meaning that - # an acknowledgement is not received from the handler, then it will be retried - # with exponential backoff according to the settings in - # {::Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}. - # @!attribute [rw] retry_count - # @return [::Integer] - # The number of attempts that the system will make to run a job using the - # exponential backoff procedure described by - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_doublings max_doublings}. - # - # The default value of retry_count is zero. - # - # If retry_count is zero, a job attempt will *not* be retried if - # it fails. Instead the Cloud Scheduler system will wait for the - # next scheduled execution time. - # - # If retry_count is set to a non-zero number then Cloud Scheduler - # will retry failed attempts, using exponential backoff, - # retry_count times, or until the next scheduled execution time, - # whichever comes first. - # - # Values greater than 5 and negative values are not allowed. - # @!attribute [rw] max_retry_duration - # @return [::Google::Protobuf::Duration] - # The time limit for retrying a failed job, measured from time when an - # execution was first attempted. If specified with - # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count}, the job - # will be retried until both limits are reached. - # - # The default value for max_retry_duration is zero, which means retry - # duration is unlimited. - # @!attribute [rw] min_backoff_duration - # @return [::Google::Protobuf::Duration] - # The minimum amount of time to wait before retrying a job after - # it fails. - # - # The default value of this field is 5 seconds. - # @!attribute [rw] max_backoff_duration - # @return [::Google::Protobuf::Duration] - # The maximum amount of time to wait before retrying a job after - # it fails. - # - # The default value of this field is 1 hour. - # @!attribute [rw] max_doublings - # @return [::Integer] - # The time between retries will double `max_doublings` times. - # - # A job's retry interval starts at - # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration}, - # then doubles `max_doublings` times, then increases linearly, and finally - # retries at intervals of - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} - # up to {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} - # times. - # - # For example, if - # {::Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration} - # is 10s, - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} - # is 300s, and `max_doublings` is 3, then the a job will first be retried in - # 10s. The retry interval will double three times, and then increase linearly - # by 2^3 * 10s. Finally, the job will retry at intervals of - # {::Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} - # until the job has been attempted - # {::Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times. - # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - # 300s, .... - # - # The default value of this field is 5. - class RetryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb deleted file mode 100644 index 3ba68d9f0837..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/cloud/scheduler/v1/target.rb +++ /dev/null @@ -1,403 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Scheduler - module V1 - # Http target. The job will be pushed to the job handler by means of - # an HTTP request via an - # {::Google::Cloud::Scheduler::V1::HttpTarget#http_method http_method} such as HTTP - # POST, HTTP GET, etc. The job is acknowledged by means of an HTTP - # response code in the range [200 - 299]. A failure to receive a response - # constitutes a failed execution. For a redirected request, the response - # returned by the redirected request is considered. - # @!attribute [rw] uri - # @return [::String] - # Required. The full URI path that the request will be sent to. This string - # must begin with either "http://" or "https://". Some examples of - # valid values for {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri} are: - # `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will - # encode some characters for safety and compatibility. The maximum allowed - # URL length is 2083 characters after encoding. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Scheduler::V1::HttpMethod] - # Which HTTP method to use for the request. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # The user can specify HTTP request headers to send with the job's - # HTTP request. This map contains the header field names and - # values. Repeated headers are not supported, but a header value can - # contain commas. These headers represent a subset of the headers - # that will accompany the job's HTTP request. Some HTTP request - # headers will be ignored or replaced. A partial list of headers that - # will be ignored or replaced is below: - # - Host: This will be computed by Cloud Scheduler and derived from - # {::Google::Cloud::Scheduler::V1::HttpTarget#uri uri}. - # * `Content-Length`: This will be computed by Cloud Scheduler. - # * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. - # * `X-Google-*`: Google internal use only. - # * `X-AppEngine-*`: Google internal use only. - # * `X-CloudScheduler`: This header will be set to true. - # * `X-CloudScheduler-JobName`: This header will contain the job name. - # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule as an - # offset of UTC parsed according to RFC3339. - # - # The total size of headers must be less than 80KB. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. A request body is allowed only if the HTTP - # method is POST, PUT, or PATCH. It is an error to set body on a job with an - # incompatible {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Scheduler::V1::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Scheduler::V1::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - class HttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine target. The job will be pushed to a job handler by means - # of an HTTP request via an - # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#http_method http_method} such - # as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an - # HTTP response code in the range [200 - 299]. Error 503 is - # considered an App Engine system error instead of an application - # error. Requests returning error 503 will be retried regardless of - # retry configuration and not counted against retry counts. Any other - # response code, or a failure to receive a response before the - # deadline, constitutes a failed attempt. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Scheduler::V1::HttpMethod] - # The HTTP method to use for the request. PATCH and OPTIONS are not - # permitted. - # @!attribute [rw] app_engine_routing - # @return [::Google::Cloud::Scheduler::V1::AppEngineRouting] - # App Engine Routing setting for the job. - # @!attribute [rw] relative_uri - # @return [::String] - # The relative URI. - # - # The relative URL must begin with "/" and must be a valid HTTP relative URL. - # It can contain a path, query string arguments, and `#` fragments. - # If the relative URL is empty, then the root path "/" will be used. - # No spaces are allowed, and the maximum length allowed is 2083 characters. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. Headers can be set - # when the job is created. - # - # Cloud Scheduler sets some headers to default values: - # - # * `User-Agent`: By default, this header is - # `"AppEngine-Google; (+http://code.google.com/appengine)"`. - # This header can be modified, but Cloud Scheduler will append - # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - # modified `User-Agent`. - # * `X-CloudScheduler`: This header will be set to true. - # * `X-CloudScheduler-JobName`: This header will contain the job name. - # * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in - # the unix-cron format, this header will contain the job schedule as an - # offset of UTC parsed according to RFC3339. - # - # If the job has an - # {::Google::Cloud::Scheduler::V1::AppEngineHttpTarget#body body}, Cloud Scheduler - # sets the following headers: - # - # * `Content-Type`: By default, the `Content-Type` header is set to - # `"application/octet-stream"`. The default can be overridden by explictly - # setting `Content-Type` to a particular media type when the job is - # created. - # For example, `Content-Type` can be set to `"application/json"`. - # * `Content-Length`: This is computed by Cloud Scheduler. This value is - # output only. It cannot be changed. - # - # The headers below are output only. They cannot be set or overridden: - # - # * `X-Google-*`: For Google internal use only. - # * `X-AppEngine-*`: For Google internal use only. - # - # In addition, some App Engine headers, which contain - # job-specific information, are also be sent to the job handler. - # @!attribute [rw] body - # @return [::String] - # Body. - # - # HTTP request body. A request body is allowed only if the HTTP method is - # POST or PUT. It will result in invalid argument error to set a body on a - # job with an incompatible - # {::Google::Cloud::Scheduler::V1::HttpMethod HttpMethod}. - class AppEngineHttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Pub/Sub target. The job will be delivered by publishing a message to - # the given Pub/Sub topic. - # @!attribute [rw] topic_name - # @return [::String] - # Required. The name of the Cloud Pub/Sub topic to which messages will - # be published when a job is delivered. The topic name must be in the - # same format as required by Pub/Sub's - # [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), - # for example `projects/PROJECT_ID/topics/TOPIC_ID`. - # - # The topic must be in the same project as the Cloud Scheduler job. - # @!attribute [rw] data - # @return [::String] - # The message payload for PubsubMessage. - # - # Pubsub message must contain either non-empty data, or at least one - # attribute. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attributes for PubsubMessage. - # - # Pubsub message must contain either non-empty data, or at least one - # attribute. - class PubsubTarget - 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 - - # App Engine Routing. - # - # For more information about services, versions, and instances see - # [An Overview of App - # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), - # [Microservices Architecture on Google App - # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] service - # @return [::String] - # App service. - # - # By default, the job is sent to the service which is the default - # service when the job is attempted. - # @!attribute [rw] version - # @return [::String] - # App version. - # - # By default, the job is sent to the version which is the default - # version when the job is attempted. - # @!attribute [rw] instance - # @return [::String] - # App instance. - # - # By default, the job is sent to an instance which is available when - # the job is attempted. - # - # Requests can only be sent to a specific instance if - # [manual scaling is used in App Engine - # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). - # App Engine Flex does not support instances. For more information, see - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] host - # @return [::String] - # Output only. The host that the job is sent to. - # - # For more information about how App Engine requests are routed, see - # [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - # - # The host is constructed as: - # - # - # * `host = [application_domain_name]`
- # `| [service] + '.' + [application_domain_name]`
- # `| [version] + '.' + [application_domain_name]`
- # `| [version_dot_service]+ '.' + [application_domain_name]`
- # `| [instance] + '.' + [application_domain_name]`
- # `| [instance_dot_service] + '.' + [application_domain_name]`
- # `| [instance_dot_version] + '.' + [application_domain_name]`
- # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - # - # * `application_domain_name` = The domain name of the app, for - # example .appspot.com, which is associated with the - # job's project ID. - # - # * `service =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # * `version =` {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} - # - # * `version_dot_service =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # * `instance =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} - # - # * `instance_dot_service =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # * `instance_dot_version =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} - # - # * `instance_dot_version_dot_service =` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} `+ '.' +` - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} - # - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service} is empty, - # then the job will be sent to the service which is the default service when - # the job is attempted. - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version} is empty, - # then the job will be sent to the version which is the default version when - # the job is attempted. - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is - # empty, then the job will be sent to an instance which is available when the - # job is attempted. - # - # If {::Google::Cloud::Scheduler::V1::AppEngineRouting#service service}, - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#version version}, or - # {::Google::Cloud::Scheduler::V1::AppEngineRouting#instance instance} is invalid, - # then the job will be sent to the default version of the default service - # when the job is attempted. - class AppEngineRouting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). - # This type of authorization should generally only be used when calling Google - # APIs hosted on *.googleapis.com. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OAuth token. - # The service account must be within the same project as the job. The caller - # must have iam.serviceAccounts.actAs permission for the service account. - # @!attribute [rw] scope - # @return [::String] - # OAuth scope to be used for generating OAuth access token. - # If not specified, "https://www.googleapis.com/auth/cloud-platform" - # will be used. - class OAuthToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OIDC token. - # The service account must be within the same project as the job. The caller - # must have iam.serviceAccounts.actAs permission for the service account. - # @!attribute [rw] audience - # @return [::String] - # Audience to be used when generating OIDC token. If not specified, the URI - # specified in target will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The HTTP method used to execute the job. - module HttpMethod - # HTTP method unspecified. Defaults to POST. - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST - POST = 1 - - # HTTP GET - GET = 2 - - # HTTP HEAD - HEAD = 3 - - # HTTP PUT - PUT = 4 - - # HTTP DELETE - DELETE = 5 - - # HTTP PATCH - PATCH = 6 - - # HTTP OPTIONS - OPTIONS = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 629894f93777..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b4a53d0ac67f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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-scheduler-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 4c0ad96e8eb9..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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-scheduler-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index c437e42a7581..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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-scheduler-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index b7de80e5ed7f..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License 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-scheduler-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 6f72e88c418d..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile deleted file mode 100644 index 219dfdb755af..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-scheduler-v1", path: "../" -else - gem "google-cloud-scheduler-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-scheduler-v1/snippets/cloud_scheduler/create_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb deleted file mode 100644 index 3c45a3dc7804..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the create_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job. It may -# require modification in order to execute successfully. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb deleted file mode 100644 index 7b67f1e7dc28..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the delete_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job. It may -# require modification in order to execute successfully. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb deleted file mode 100644 index 108c43998670..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the get_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job. It may require -# modification in order to execute successfully. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb deleted file mode 100644 index bcfa1a448aba..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the list_jobs call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs. It may require -# modification in order to execute successfully. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - p item - end -end -# [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb deleted file mode 100644 index c9d0b84ce1e7..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the pause_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job. It may require -# modification in order to execute successfully. -# -def pause_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::PauseJobRequest.new - - # Call the pause_job method. - result = client.pause_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb deleted file mode 100644 index 0d184a92e215..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the resume_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job. It may -# require modification in order to execute successfully. -# -def resume_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new - - # Call the resume_job method. - result = client.resume_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb deleted file mode 100644 index ab8c7d81d122..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the run_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job. It may require -# modification in order to execute successfully. -# -def run_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::RunJobRequest.new - - # Call the run_job method. - result = client.run_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb b/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb deleted file mode 100644 index e574b8f5f4fa..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] -require "google/cloud/scheduler/v1" - -## -# Snippet for the update_job call in the CloudScheduler service -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job. It may -# require modification in order to execute successfully. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Scheduler::V1::Job. - p result -end -# [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json b/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json deleted file mode 100644 index e99f67432a10..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-scheduler-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.scheduler.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync", - "title": "Snippet for the list_jobs call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::ListJobsResponse", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.ListJobs", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 45, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_GetJob_sync", - "title": "Snippet for the get_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.GetJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync", - "title": "Snippet for the create_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.CreateJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync", - "title": "Snippet for the update_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.UpdateJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync", - "title": "Snippet for the delete_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.DeleteJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync", - "title": "Snippet for the pause_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/pause_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::PauseJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "PauseJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.PauseJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync", - "title": "Snippet for the resume_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/resume_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::ResumeJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "ResumeJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.ResumeJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudscheduler_v1_generated_CloudScheduler_RunJob_sync", - "title": "Snippet for the run_job call in the CloudScheduler service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job. It may require modification in order to execute successfully.", - "file": "cloud_scheduler/run_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_job", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Scheduler::V1::RunJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Scheduler::V1::Job", - "client": { - "short_name": "CloudScheduler::Client", - "full_name": "::Google::Cloud::Scheduler::V1::CloudScheduler::Client" - }, - "method": { - "short_name": "RunJob", - "full_name": "google.cloud.scheduler.v1.CloudScheduler.RunJob", - "service": { - "short_name": "CloudScheduler", - "full_name": "google.cloud.scheduler.v1.CloudScheduler" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 41, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb deleted file mode 100644 index 6455aac60fd7..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing 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/scheduler/v1/cloud_scheduler" - -class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientPathsTest < Minitest::Test - def test_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", location: "value1", job: "value2" - assert_equal "projects/value0/locations/value1/jobs/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb deleted file mode 100644 index 70047dc74c80..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_rest_test.rb +++ /dev/null @@ -1,518 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/scheduler/v1/cloudscheduler_pb" -require "google/cloud/scheduler/v1/cloud_scheduler/rest" - - -class ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job: job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_update_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_count - end - end - end - - def test_pause_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_pause_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_job_client_stub.call_count - end - end - end - - def test_resume_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_resume_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_job_client_stub.call_count - end - end - end - - def test_run_job - # Create test objects. - client_result = ::Google::Cloud::Scheduler::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - run_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::ServiceStub.stub :transcode_run_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_job_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - Gapic::Rest::ClientStub.stub :new, nil do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb deleted file mode 100644 index a2826fcabf59..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/google/cloud/scheduler/v1/cloud_scheduler_test.rb +++ /dev/null @@ -1,544 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing 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/scheduler/v1/cloudscheduler_pb" -require "google/cloud/scheduler/v1/cloudscheduler_services_pb" -require "google/cloud/scheduler/v1/cloud_scheduler" - -class ::Google::Cloud::Scheduler::V1::CloudScheduler::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Scheduler::V1::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_jobs parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Scheduler::V1::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Scheduler::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job: job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Scheduler::V1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::UpdateJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Scheduler::V1::Job), request["job"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_job job: job, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_job ::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_job({ job: job, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Scheduler::V1::UpdateJobRequest.new(job: job, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_rpc_count - end - end - - def test_delete_job - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::DeleteJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Scheduler::V1::DeleteJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_rpc_count - end - end - - def test_pause_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::PauseJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_job ::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_job(::Google::Cloud::Scheduler::V1::PauseJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, pause_job_client_stub.call_rpc_count - end - end - - def test_resume_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::ResumeJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_job ::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_job(::Google::Cloud::Scheduler::V1::ResumeJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, resume_job_client_stub.call_rpc_count - end - end - - def test_run_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Scheduler::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_job, name - assert_kind_of ::Google::Cloud::Scheduler::V1::RunJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_job_client_stub do - # Create client - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_job ::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_job(::Google::Cloud::Scheduler::V1::RunJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_job_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - Gapic::ServiceStub.stub :new, nil do - client = ::Google::Cloud::Scheduler::V1::CloudScheduler::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::Scheduler::V1::CloudScheduler::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb b/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb deleted file mode 100644 index 8f4f6cf3de22..000000000000 --- a/owl-bot-staging/google-cloud-scheduler-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "simplecov" - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc"