diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/.gitignore b/owl-bot-staging/google-cloud-data_catalog-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-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-data_catalog-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-data_catalog-v1/.repo-metadata.json new file mode 100644 index 000000000000..4367d28d3f76 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "datacatalog.googleapis.com", + "api_shortname": "datacatalog", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-data_catalog-v1/latest", + "distribution_name": "google-cloud-data_catalog-v1", + "is_cloud": true, + "language": "ruby", + "name": "datacatalog", + "name_pretty": "Data Catalog V1 API", + "product_documentation": "https://cloud.google.com/data-catalog", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "DataCatalog is a centralized and unified data catalog service for all your Cloud resources, where users and systems can discover data, explore and curate its semantics, understand how to act on it, and help govern its usage. Note that google-cloud-data_catalog-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-data_catalog instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DATA_CATALOG", + "ruby-cloud-product-url": "https://cloud.google.com/data-catalog", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/.rubocop.yml b/owl-bot-staging/google-cloud-data_catalog-v1/.rubocop.yml new file mode 100644 index 000000000000..06198693b78e --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-data_catalog-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-data_catalog-v1.rb" diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/.toys.rb b/owl-bot-staging/google-cloud-data_catalog-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/.yardopts b/owl-bot-staging/google-cloud-data_catalog-v1/.yardopts new file mode 100644 index 000000000000..a51ca72b52e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Data Catalog 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-data_catalog-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-data_catalog-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..223d495f97cf --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-data_catalog-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-data_catalog-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/data_catalog/v1" + +client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/data_catalog/v1" + +::Google::Cloud::DataCatalog::V1::DataCatalog::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-data_catalog-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/data_catalog/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-data_catalog-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/Gemfile b/owl-bot-staging/google-cloud-data_catalog-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/LICENSE.md b/owl-bot-staging/google-cloud-data_catalog-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-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-data_catalog-v1/README.md b/owl-bot-staging/google-cloud-data_catalog-v1/README.md new file mode 100644 index 000000000000..c576152c3afe --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Data Catalog V1 API + +A fully managed and highly scalable data discovery and metadata management service. + +DataCatalog is a centralized and unified data catalog service for all your Cloud resources, where users and systems can discover data, explore and curate its semantics, understand how to act on it, and help govern its usage. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Data Catalog V1 API. Most users should consider using +the main client gem, +[google-cloud-data_catalog](https://rubygems.org/gems/google-cloud-data_catalog). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-data_catalog-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/datacatalog.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/data_catalog/v1" + +client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +request = ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new # (request fields as keyword arguments...) +response = client.search_catalog request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-data_catalog-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/data-catalog) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/data_catalog/v1" +require "logger" + +client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-data_catalog`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-data_catalog-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-data_catalog`. +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-data_catalog-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-data_catalog-v1/Rakefile b/owl-bot-staging/google-cloud-data_catalog-v1/Rakefile new file mode 100644 index 000000000000..5cc8c0a213ad --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-data_catalog-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["DATA_CATALOG_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["DATA_CATALOG_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["DATA_CATALOG_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 DATA_CATALOG_TEST_PROJECT=test123 DATA_CATALOG_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/data_catalog/v1/data_catalog/credentials" + ::Google::Cloud::DataCatalog::V1::DataCatalog::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["DATA_CATALOG_PROJECT"] = project + ENV["DATA_CATALOG_TEST_PROJECT"] = project + ENV["DATA_CATALOG_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-data_catalog-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-data_catalog-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-data_catalog-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-data_catalog-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-data_catalog-v1" + header "google-cloud-data_catalog-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-data_catalog-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-data_catalog-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-data_catalog-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-data_catalog-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-data_catalog-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-data_catalog-v1/gapic_metadata.json new file mode 100644 index 000000000000..d8eafa1dc181 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/gapic_metadata.json @@ -0,0 +1,301 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.datacatalog.v1", + "libraryPackage": "::Google::Cloud::DataCatalog::V1", + "services": { + "DataCatalog": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client", + "rpcs": { + "SearchCatalog": { + "methods": [ + "search_catalog" + ] + }, + "CreateEntryGroup": { + "methods": [ + "create_entry_group" + ] + }, + "GetEntryGroup": { + "methods": [ + "get_entry_group" + ] + }, + "UpdateEntryGroup": { + "methods": [ + "update_entry_group" + ] + }, + "DeleteEntryGroup": { + "methods": [ + "delete_entry_group" + ] + }, + "ListEntryGroups": { + "methods": [ + "list_entry_groups" + ] + }, + "CreateEntry": { + "methods": [ + "create_entry" + ] + }, + "UpdateEntry": { + "methods": [ + "update_entry" + ] + }, + "DeleteEntry": { + "methods": [ + "delete_entry" + ] + }, + "GetEntry": { + "methods": [ + "get_entry" + ] + }, + "LookupEntry": { + "methods": [ + "lookup_entry" + ] + }, + "ListEntries": { + "methods": [ + "list_entries" + ] + }, + "ModifyEntryOverview": { + "methods": [ + "modify_entry_overview" + ] + }, + "ModifyEntryContacts": { + "methods": [ + "modify_entry_contacts" + ] + }, + "CreateTagTemplate": { + "methods": [ + "create_tag_template" + ] + }, + "GetTagTemplate": { + "methods": [ + "get_tag_template" + ] + }, + "UpdateTagTemplate": { + "methods": [ + "update_tag_template" + ] + }, + "DeleteTagTemplate": { + "methods": [ + "delete_tag_template" + ] + }, + "CreateTagTemplateField": { + "methods": [ + "create_tag_template_field" + ] + }, + "UpdateTagTemplateField": { + "methods": [ + "update_tag_template_field" + ] + }, + "RenameTagTemplateField": { + "methods": [ + "rename_tag_template_field" + ] + }, + "RenameTagTemplateFieldEnumValue": { + "methods": [ + "rename_tag_template_field_enum_value" + ] + }, + "DeleteTagTemplateField": { + "methods": [ + "delete_tag_template_field" + ] + }, + "CreateTag": { + "methods": [ + "create_tag" + ] + }, + "UpdateTag": { + "methods": [ + "update_tag" + ] + }, + "DeleteTag": { + "methods": [ + "delete_tag" + ] + }, + "ListTags": { + "methods": [ + "list_tags" + ] + }, + "ReconcileTags": { + "methods": [ + "reconcile_tags" + ] + }, + "StarEntry": { + "methods": [ + "star_entry" + ] + }, + "UnstarEntry": { + "methods": [ + "unstar_entry" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "ImportEntries": { + "methods": [ + "import_entries" + ] + }, + "SetConfig": { + "methods": [ + "set_config" + ] + }, + "RetrieveConfig": { + "methods": [ + "retrieve_config" + ] + }, + "RetrieveEffectiveConfig": { + "methods": [ + "retrieve_effective_config" + ] + } + } + } + } + }, + "PolicyTagManager": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client", + "rpcs": { + "CreateTaxonomy": { + "methods": [ + "create_taxonomy" + ] + }, + "DeleteTaxonomy": { + "methods": [ + "delete_taxonomy" + ] + }, + "UpdateTaxonomy": { + "methods": [ + "update_taxonomy" + ] + }, + "ListTaxonomies": { + "methods": [ + "list_taxonomies" + ] + }, + "GetTaxonomy": { + "methods": [ + "get_taxonomy" + ] + }, + "CreatePolicyTag": { + "methods": [ + "create_policy_tag" + ] + }, + "DeletePolicyTag": { + "methods": [ + "delete_policy_tag" + ] + }, + "UpdatePolicyTag": { + "methods": [ + "update_policy_tag" + ] + }, + "ListPolicyTags": { + "methods": [ + "list_policy_tags" + ] + }, + "GetPolicyTag": { + "methods": [ + "get_policy_tag" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, + "PolicyTagManagerSerialization": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client", + "rpcs": { + "ReplaceTaxonomy": { + "methods": [ + "replace_taxonomy" + ] + }, + "ImportTaxonomies": { + "methods": [ + "import_taxonomies" + ] + }, + "ExportTaxonomies": { + "methods": [ + "export_taxonomies" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/google-cloud-data_catalog-v1.gemspec b/owl-bot-staging/google-cloud-data_catalog-v1/google-cloud-data_catalog-v1.gemspec new file mode 100644 index 000000000000..896c07f61532 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/google-cloud-data_catalog-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/data_catalog/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-data_catalog-v1" + gem.version = Google::Cloud::DataCatalog::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "DataCatalog is a centralized and unified data catalog service for all your Cloud resources, where users and systems can discover data, explore and curate its semantics, understand how to act on it, and help govern its usage. Note that google-cloud-data_catalog-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-data_catalog instead. See the readme for more details." + gem.summary = "A fully managed and highly scalable data discovery and metadata management service." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.24.0", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-iam-v1", ">= 0.7", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google-cloud-data_catalog-v1.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google-cloud-data_catalog-v1.rb new file mode 100644 index 000000000000..415b76d123d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google-cloud-data_catalog-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/data_catalog/v1" diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1.rb new file mode 100644 index 000000000000..e0d9d15ee899 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/data_catalog/v1/data_catalog" +require "google/cloud/data_catalog/v1/policy_tag_manager" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization" +require "google/cloud/data_catalog/v1/version" + +module Google + module Cloud + module DataCatalog + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/data_catalog/v1" + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/data_catalog/v1" + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/data_catalog/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog.rb new file mode 100644 index 000000000000..a1853858aeb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/data_catalog/v1/version" + +require "google/cloud/data_catalog/v1/data_catalog/credentials" +require "google/cloud/data_catalog/v1/data_catalog/paths" +require "google/cloud/data_catalog/v1/data_catalog/operations" +require "google/cloud/data_catalog/v1/data_catalog/client" +require "google/cloud/data_catalog/v1/data_catalog/rest" + +module Google + module Cloud + module DataCatalog + module V1 + ## + # Data Catalog API service allows you to discover, understand, and manage + # your data. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/data_catalog/v1/data_catalog" + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/data_catalog/v1/data_catalog/rest" + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + module DataCatalog + end + end + end + end +end + +helper_path = ::File.join __dir__, "data_catalog", "helpers.rb" +require "google/cloud/data_catalog/v1/data_catalog/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb new file mode 100644 index 000000000000..60cbd7133b4b --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/client.rb @@ -0,0 +1,4374 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/datacatalog/v1/datacatalog_pb" +require "google/iam/v1" + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + ## + # Client for the DataCatalog service. + # + # Data Catalog API service allows you to discover, understand, and manage + # your data. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :data_catalog_stub + + ## + # Configure the DataCatalog Client class. + # + # See {::Google::Cloud::DataCatalog::V1::DataCatalog::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DataCatalog clients + # ::Google::Cloud::DataCatalog::V1::DataCatalog::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", "DataCatalog", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 8, 13] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DataCatalog 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::DataCatalog::V1::DataCatalog::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @data_catalog_stub.universe_domain + end + + ## + # Create a new DataCatalog client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DataCatalog 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/datacatalog/v1/datacatalog_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @data_catalog_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DataCatalog::V1::DataCatalog::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @data_catalog_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_catalog_stub.endpoint + config.universe_domain = @data_catalog_stub.universe_domain + config.logger = @data_catalog_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DataCatalog::V1::DataCatalog::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @data_catalog_stub.logger + end + + # Service calls + + ## + # Searches Data Catalog for multiple resources like entries and tags that + # match a query. + # + # This is a [Custom Method] + # (https://cloud.google.com/apis/design/custom_methods) that doesn't return + # all information on a resource, only its ID and high level fields. To get + # more information, you can subsequently call specific get methods. + # + # Note: Data Catalog search queries don't guarantee full recall. Results + # that match your query might not be returned, even in subsequent + # result pages. Additionally, returned (and not returned) results can vary + # if you repeat search queries. + # + # For more information, see [Data Catalog search syntax] + # (https://cloud.google.com/data-catalog/docs/how-to/search-reference). + # + # @overload search_catalog(request, options = nil) + # Pass arguments to `search_catalog` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::SearchCatalogRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_catalog(scope: nil, query: nil, page_size: nil, page_token: nil, order_by: nil, admin_search: nil) + # Pass arguments to `search_catalog` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope, ::Hash] + # Required. The scope of this search request. + # + # The `scope` is invalid if `include_org_ids`, `include_project_ids` are + # empty AND `include_gcp_public_datasets` is set to `false`. In this case, + # the request returns an error. + # @param query [::String] + # Optional. The query string with a minimum of 3 characters and specific + # syntax. For more information, see [Data Catalog search + # syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). + # + # An empty query string returns all data assets (in the specified scope) + # that you have access to. + # + # A query string can be a simple `xyz` or qualified by predicates: + # + # * `name:x` + # * `column:y` + # * `description:z` + # @param page_size [::Integer] + # Upper bound on the number of results you can get in a single response. + # + # Can't be negative or 0, defaults to 10 in this case. + # The maximum number is 1000. If exceeded, throws an "invalid argument" + # exception. + # @param page_token [::String] + # Optional. Pagination token that, if specified, returns the next page of + # search results. If empty, returns the first page. + # + # This token is returned in the + # {::Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token} + # field of the response to a previous + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalogRequest} + # call. + # @param order_by [::String] + # Specifies the order of results. + # + # Currently supported case-sensitive values are: + # + # * `relevance` that can only be descending + # * `last_modified_timestamp [asc|desc]` with descending (`desc`) as default + # * `default` that can only be descending + # + # Search queries don't guarantee full recall. Results that match your query + # might not be returned, even in subsequent result pages. Additionally, + # returned (and not returned) results can vary if you repeat search queries. + # If you are experiencing recall issues and you don't have to fetch the + # results in any specific order, consider setting this parameter to + # `default`. + # + # If this parameter is omitted, it defaults to the descending `relevance`. + # @param admin_search [::Boolean] + # Optional. If set, use searchAll permission granted on organizations from + # `include_org_ids` and projects from `include_project_ids` instead of the + # fine grained per resource permissions when filtering the search results. + # The only allowed `order_by` criteria for admin_search mode is `default`. + # Using this flags guarantees a full recall of the search results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new + # + # # Call the search_catalog method. + # result = client.search_catalog request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult. + # p item + # end + # + def search_catalog request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search_catalog.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_catalog.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_catalog.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :search_catalog, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @data_catalog_stub, :search_catalog, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an entry group. + # + # An entry group contains logically related entries together with [Cloud + # Identity and Access Management](/data-catalog/docs/concepts/iam) policies. + # These policies specify users who can create, edit, and view entries + # within entry groups. + # + # Data Catalog automatically creates entry groups with names that start with + # the `@` symbol for the following resources: + # + # * BigQuery entries (`@bigquery`) + # * Pub/Sub topics (`@pubsub`) + # * Dataproc Metastore services (`@dataproc_metastore_{SERVICE_NAME_HASH}`) + # + # You can create your own entry groups for Cloud Storage fileset entries + # and custom entries together with the corresponding IAM policies. + # User-created entry groups can't contain the `@` symbol, it is reserved + # for automatically created groups. + # + # Entry groups, like entries, can be searched. + # + # A maximum of 10,000 entry groups may be created per organization across all + # locations. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload create_entry_group(request, options = nil) + # Pass arguments to `create_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_entry_group(parent: nil, entry_group_id: nil, entry_group: nil) + # Pass arguments to `create_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The names of the project and location that the new entry group + # belongs to. + # + # Note: The entry group itself and its child resources might not be + # stored in the location specified in its name. + # @param entry_group_id [::String] + # Required. The ID of the entry group to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and must start with a letter or underscore. + # The maximum size is 64 bytes when encoded in UTF-8. + # @param entry_group [::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash] + # The entry group to create. Defaults to empty. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new + # + # # Call the create_entry_group method. + # result = client.create_entry_group request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + # p result + # + def create_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest + + # Converts hash and nil to 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_entry_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :create_entry_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an entry group. + # + # @overload get_entry_group(request, options = nil) + # Pass arguments to `get_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_entry_group(name: nil, read_mask: nil) + # Pass arguments to `get_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry group to get. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields to return. If empty or omitted, all fields are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new + # + # # Call the get_entry_group method. + # result = client.get_entry_group request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + # p result + # + def get_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest + + # Converts hash and nil to 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_entry_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :get_entry_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an entry group. + # + # You must enable the Data Catalog API in the project identified by + # the `entry_group.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_entry_group(request, options = nil) + # Pass arguments to `update_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entry_group(entry_group: nil, update_mask: nil) + # Pass arguments to `update_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entry_group [::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash] + # Required. Updates for the entry group. The `name` field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on an entry group. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new + # + # # Call the update_entry_group method. + # result = client.update_entry_group request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + # p result + # + def update_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest + + # Converts hash and nil to 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.entry_group&.name + header_params["entry_group.name"] = request.entry_group.name + end + + request_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_entry_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :update_entry_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an entry group. + # + # You must enable the Data Catalog API in the project + # identified by the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_entry_group(request, options = nil) + # Pass arguments to `delete_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_entry_group(name: nil, force: nil) + # Pass arguments to `delete_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry group to delete. + # @param force [::Boolean] + # Optional. If true, deletes all entries in the entry group. + # + # @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/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new + # + # # Call the delete_entry_group method. + # result = client.delete_entry_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest + + # Converts hash and nil to 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_entry_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :delete_entry_group, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists entry groups. + # + # @overload list_entry_groups(request, options = nil) + # Pass arguments to `list_entry_groups` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_entry_groups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_entry_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the location that contains the entry groups to list. + # + # Can be provided as a URL. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # Default is 10. Maximum limit is 1000. + # Throws an invalid argument if `page_size` is greater than 1000. + # @param page_token [::String] + # Optional. Pagination token that specifies the next page to return. + # If empty, returns the first page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.new + # + # # Call the list_entry_groups method. + # result = client.list_entry_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup. + # p item + # end + # + def list_entry_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest + + # Converts hash and nil to 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_entry_groups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_entry_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_entry_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :list_entry_groups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @data_catalog_stub, :list_entry_groups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an entry. + # + # You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', + # or custom types. Data Catalog automatically creates entries with other + # types during metadata ingestion from integrated systems. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # An entry group can have a maximum of 100,000 entries. + # + # @overload create_entry(request, options = nil) + # Pass arguments to `create_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_entry(parent: nil, entry_id: nil, entry: nil) + # Pass arguments to `create_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the entry group this entry belongs to. + # + # Note: The entry itself and its child resources might not be stored in + # the location specified in its name. + # @param entry_id [::String] + # Required. The ID of the entry to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # and underscores (_). + # The maximum size is 64 bytes when encoded in UTF-8. + # @param entry [::Google::Cloud::DataCatalog::V1::Entry, ::Hash] + # Required. The entry to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateEntryRequest.new + # + # # Call the create_entry method. + # result = client.create_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def create_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateEntryRequest + + # Converts hash and nil to 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :create_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing entry. + # + # You must enable the Data Catalog API in the project identified by + # the `entry.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_entry(request, options = nil) + # Pass arguments to `update_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entry(entry: nil, update_mask: nil) + # Pass arguments to `update_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entry [::Google::Cloud::DataCatalog::V1::Entry, ::Hash] + # Required. Updates for the entry. The `name` field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on an entry. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # You can modify only the fields listed below. + # + # For entries with type `DATA_STREAM`: + # + # * `schema` + # + # For entries with type `FILESET`: + # + # * `schema` + # * `display_name` + # * `description` + # * `gcs_fileset_spec` + # * `gcs_fileset_spec.file_patterns` + # + # For entries with `user_specified_type`: + # + # * `schema` + # * `display_name` + # * `description` + # * `user_specified_type` + # * `user_specified_system` + # * `linked_resource` + # * `source_system_timestamps` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new + # + # # Call the update_entry method. + # result = client.update_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def update_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest + + # Converts hash and nil to 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.entry&.name + header_params["entry.name"] = request.entry.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :update_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing entry. + # + # You can delete only the entries created by the + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry CreateEntry} + # method. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_entry(request, options = nil) + # Pass arguments to `delete_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_entry(name: nil) + # Pass arguments to `delete_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new + # + # # Call the delete_entry method. + # result = client.delete_entry request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest + + # Converts hash and nil to 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :delete_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an entry. + # + # @overload get_entry(request, options = nil) + # Pass arguments to `get_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_entry(name: nil) + # Pass arguments to `get_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetEntryRequest.new + # + # # Call the get_entry method. + # result = client.get_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def get_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetEntryRequest + + # Converts hash and nil to 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :get_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an entry by its target resource name. + # + # The resource name comes from the source Google Cloud Platform service. + # + # @overload lookup_entry(request, options = nil) + # Pass arguments to `lookup_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::LookupEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::LookupEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload lookup_entry(linked_resource: nil, sql_resource: nil, fully_qualified_name: nil, project: nil, location: nil) + # Pass arguments to `lookup_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param linked_resource [::String] + # The full name of the Google Cloud Platform resource the Data Catalog + # entry represents. For more information, see [Full Resource Name] + # (https://cloud.google.com/apis/design/resource_names#full_resource_name). + # + # Full names are case-sensitive. For example: + # + # * `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}` + # * `//pubsub.googleapis.com/projects/{PROJECT_ID}/topics/{TOPIC_ID}` + # @param sql_resource [::String] + # The SQL name of the entry. SQL names are case-sensitive. + # + # Examples: + # + # * `pubsub.topic.{PROJECT_ID}.{TOPIC_ID}` + # * `pubsub.topic.{PROJECT_ID}.`\``{TOPIC.ID.SEPARATED.WITH.DOTS}`\` + # * `bigquery.table.{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}` + # * `bigquery.dataset.{PROJECT_ID}.{DATASET_ID}` + # * `datacatalog.entry.{PROJECT_ID}.{LOCATION_ID}.{ENTRY_GROUP_ID}.{ENTRY_ID}` + # + # Identifiers (`*_ID`) should comply with the + # [Lexical structure in Standard SQL] + # (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical). + # @param fully_qualified_name [::String] + # [Fully Qualified Name + # (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + # of the resource. + # + # FQNs take two forms: + # + # * For non-regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # * For regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # Example for a DPMS table: + # + # `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` + # @param project [::String] + # Project where the lookup should be performed. Required to lookup + # entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + # using its `fully_qualified_name`. Ignored in other cases. + # @param location [::String] + # Location where the lookup should be performed. Required to lookup + # entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + # using its `fully_qualified_name`. Ignored in other cases. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::LookupEntryRequest.new + # + # # Call the lookup_entry method. + # result = client.lookup_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def lookup_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::LookupEntryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.lookup_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.lookup_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.lookup_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :lookup_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists entries. + # + # Note: Currently, this method can list only custom entries. + # To get a list of both custom and automatically created entries, use + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalog}. + # + # @overload list_entries(request, options = nil) + # Pass arguments to `list_entries` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_entries(parent: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the entry group that contains the entries to list. + # + # Can be provided in URL format. + # @param page_size [::Integer] + # The maximum number of items to return. Default is 10. Maximum limit is + # 1000. Throws an invalid argument if `page_size` is more than 1000. + # @param page_token [::String] + # Pagination token that specifies the next page to return. If empty, the + # first page is returned. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields to return for each entry. If empty or omitted, all + # fields are returned. + # + # For example, to return a list of entries with only the `name` field, + # set `read_mask` to only one path with the `name` value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListEntriesRequest.new + # + # # Call the list_entries method. + # result = client.list_entries request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry. + # p item + # end + # + def list_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListEntriesRequest + + # Converts hash and nil to 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_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_entries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :list_entries, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @data_catalog_stub, :list_entries, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Modifies entry overview, part of the business context of an + # {::Google::Cloud::DataCatalog::V1::Entry Entry}. + # + # To call this method, you must have the `datacatalog.entries.updateOverview` + # IAM permission on the corresponding project. + # + # @overload modify_entry_overview(request, options = nil) + # Pass arguments to `modify_entry_overview` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload modify_entry_overview(name: nil, entry_overview: nil) + # Pass arguments to `modify_entry_overview` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the entry. + # @param entry_overview [::Google::Cloud::DataCatalog::V1::EntryOverview, ::Hash] + # Required. The new value for the Entry Overview. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::EntryOverview] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryOverview] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new + # + # # Call the modify_entry_overview method. + # result = client.modify_entry_overview request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryOverview. + # p result + # + def modify_entry_overview request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.modify_entry_overview.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.modify_entry_overview.timeout, + metadata: metadata, + retry_policy: @config.rpcs.modify_entry_overview.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :modify_entry_overview, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Modifies contacts, part of the business context of an + # {::Google::Cloud::DataCatalog::V1::Entry Entry}. + # + # To call this method, you must have the `datacatalog.entries.updateContacts` + # IAM permission on the corresponding project. + # + # @overload modify_entry_contacts(request, options = nil) + # Pass arguments to `modify_entry_contacts` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload modify_entry_contacts(name: nil, contacts: nil) + # Pass arguments to `modify_entry_contacts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the entry. + # @param contacts [::Google::Cloud::DataCatalog::V1::Contacts, ::Hash] + # Required. The new value for the Contacts. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Contacts] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Contacts] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new + # + # # Call the modify_entry_contacts method. + # result = client.modify_entry_contacts request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Contacts. + # p result + # + def modify_entry_contacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.modify_entry_contacts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.modify_entry_contacts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.modify_entry_contacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :modify_entry_contacts, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a tag template. + # + # You must enable the Data Catalog API in the project identified by the + # `parent` parameter. + # For more information, see [Data Catalog resource project] + # (https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload create_tag_template(request, options = nil) + # Pass arguments to `create_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_tag_template(parent: nil, tag_template_id: nil, tag_template: nil) + # Pass arguments to `create_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project and the template location + # [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + # @param tag_template_id [::String] + # Required. The ID of the tag template to create. + # + # The ID must contain only lowercase letters (a-z), numbers (0-9), + # or underscores (_), and must start with a letter or underscore. + # The maximum size is 64 bytes when encoded in UTF-8. + # @param tag_template [::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash] + # Required. The tag template to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new + # + # # Call the create_tag_template method. + # result = client.create_tag_template request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + # p result + # + def create_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest + + # Converts hash and nil to 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_tag_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :create_tag_template, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a tag template. + # + # @overload get_tag_template(request, options = nil) + # Pass arguments to `get_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_tag_template(name: nil) + # Pass arguments to `get_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new + # + # # Call the get_tag_template method. + # result = client.get_tag_template request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + # p result + # + def get_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest + + # Converts hash and nil to 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_tag_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :get_tag_template, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a tag template. + # + # You can't update template fields with this method. These fields are + # separate resources with their own create, update, and delete methods. + # + # You must enable the Data Catalog API in the project identified by + # the `tag_template.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_tag_template(request, options = nil) + # Pass arguments to `update_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_template(tag_template: nil, update_mask: nil) + # Pass arguments to `update_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_template [::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash] + # Required. The template to update. The `name` field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on a tag template. Currently, + # only `display_name` and `is_publicly_readable` can be overwritten. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # Note: Updating the `is_publicly_readable` field may require up to 12 + # hours to take effect in search results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new + # + # # Call the update_tag_template method. + # result = client.update_tag_template request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + # p result + # + def update_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest + + # Converts hash and nil to 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.tag_template&.name + header_params["tag_template.name"] = request.tag_template.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_tag_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :update_tag_template, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a tag template and all tags that use it. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_tag_template(request, options = nil) + # Pass arguments to `delete_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_tag_template(name: nil, force: nil) + # Pass arguments to `delete_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template to delete. + # @param force [::Boolean] + # Required. If true, deletes all tags that use this template. + # + # Currently, `true` is the only supported value. + # + # @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/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new + # + # # Call the delete_tag_template method. + # result = client.delete_tag_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest + + # Converts hash and nil to 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_tag_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :delete_tag_template, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a field in a tag template. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload create_tag_template_field(request, options = nil) + # Pass arguments to `create_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_tag_template_field(parent: nil, tag_template_field_id: nil, tag_template_field: nil) + # Pass arguments to `create_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project and the template location + # [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + # @param tag_template_field_id [::String] + # Required. The ID of the tag template field to create. + # + # Note: Adding a required field to an existing template is *not* allowed. + # + # Field IDs can contain letters (both uppercase and lowercase), numbers + # (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 + # character long and at most 128 characters long. Field IDs must also be + # unique within their template. + # @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash] + # Required. The tag template field to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new + # + # # Call the create_tag_template_field method. + # result = client.create_tag_template_field request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def create_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest + + # Converts hash and nil to 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_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_tag_template_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :create_tag_template_field, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a field in a tag template. + # + # You can't update the field type with this method. + # + # You must enable the Data Catalog API in the project + # identified by the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_tag_template_field(request, options = nil) + # Pass arguments to `update_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_template_field(name: nil, tag_template_field: nil, update_mask: nil) + # Pass arguments to `update_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template field. + # @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash] + # Required. The template to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Names of fields whose values to overwrite on an individual field + # of a tag template. The following fields are modifiable: + # + # * `display_name` + # * `type.enum_type` + # * `is_required` + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the request + # body, their values are emptied with one exception: when updating an enum + # type, the provided values are merged with the existing values. Therefore, + # enum values can only be added, existing enum values cannot be deleted or + # renamed. + # + # Additionally, updating a template field from optional to required is + # *not* allowed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new + # + # # Call the update_tag_template_field method. + # result = client.update_tag_template_field request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def update_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest + + # Converts hash and nil to 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_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_tag_template_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :update_tag_template_field, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renames a field in a tag template. + # + # You must enable the Data Catalog API in the project identified by the + # `name` parameter. For more information, see [Data Catalog resource project] + # (https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload rename_tag_template_field(request, options = nil) + # Pass arguments to `rename_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rename_tag_template_field(name: nil, new_tag_template_field_id: nil) + # Pass arguments to `rename_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template field. + # @param new_tag_template_field_id [::String] + # Required. The new ID of this tag template field. For example, + # `my_new_field`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new + # + # # Call the rename_tag_template_field method. + # result = client.rename_tag_template_field request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def rename_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rename_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rename_tag_template_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rename_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :rename_tag_template_field, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renames an enum value in a tag template. + # + # Within a single enum field, enum values must be unique. + # + # @overload rename_tag_template_field_enum_value(request, options = nil) + # Pass arguments to `rename_tag_template_field_enum_value` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rename_tag_template_field_enum_value(name: nil, new_enum_value_display_name: nil) + # Pass arguments to `rename_tag_template_field_enum_value` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the enum field value. + # @param new_enum_value_display_name [::String] + # Required. The new display name of the enum value. For example, + # `my_new_enum_value`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new + # + # # Call the rename_tag_template_field_enum_value method. + # result = client.rename_tag_template_field_enum_value request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def rename_tag_template_field_enum_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rename_tag_template_field_enum_value.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rename_tag_template_field_enum_value.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rename_tag_template_field_enum_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :rename_tag_template_field_enum_value, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a field in a tag template and all uses of this field from the tags + # based on this template. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_tag_template_field(request, options = nil) + # Pass arguments to `delete_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_tag_template_field(name: nil, force: nil) + # Pass arguments to `delete_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template field to delete. + # @param force [::Boolean] + # Required. If true, deletes this field from any tags that use it. + # + # Currently, `true` is the only supported value. + # + # @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/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new + # + # # Call the delete_tag_template_field method. + # result = client.delete_tag_template_field request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest + + # Converts hash and nil to 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_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_tag_template_field.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :delete_tag_template_field, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a tag and assigns it to: + # + # * An {::Google::Cloud::DataCatalog::V1::Entry Entry} if the method name is + # `projects.locations.entryGroups.entries.tags.create`. + # * Or {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup}if the method + # name is `projects.locations.entryGroups.tags.create`. + # + # Note: The project identified by the `parent` parameter for the [tag] + # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) + # and the [tag template] + # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) + # used to create the tag must be in the same organization. + # + # @overload create_tag(request, options = nil) + # Pass arguments to `create_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_tag(parent: nil, tag: nil) + # Pass arguments to `create_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the resource to attach this tag to. + # + # Tags can be attached to entries or entry groups. An entry can have up to + # 1000 attached tags. + # + # Note: The tag and its child resources might not be stored in + # the location specified in its name. + # @param tag [::Google::Cloud::DataCatalog::V1::Tag, ::Hash] + # Required. The tag to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Tag] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTagRequest.new + # + # # Call the create_tag method. + # result = client.create_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + # p result + # + def create_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagRequest + + # Converts hash and nil to 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_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :create_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing tag. + # + # @overload update_tag(request, options = nil) + # Pass arguments to `update_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag(tag: nil, update_mask: nil) + # Pass arguments to `update_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag [::Google::Cloud::DataCatalog::V1::Tag, ::Hash] + # Required. The updated tag. The "name" field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on a tag. Currently, a tag has + # the only modifiable field with the name `fields`. + # + # In general, if this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Tag] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTagRequest.new + # + # # Call the update_tag method. + # result = client.update_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + # p result + # + def update_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagRequest + + # Converts hash and nil to 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_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.tag&.name + header_params["tag.name"] = request.tag.name + end + + request_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_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :update_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a tag. + # + # @overload delete_tag(request, options = nil) + # Pass arguments to `delete_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_tag(name: nil) + # Pass arguments to `delete_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTagRequest.new + # + # # Call the delete_tag method. + # result = client.delete_tag request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagRequest + + # Converts hash and nil to 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_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :delete_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists tags assigned to an {::Google::Cloud::DataCatalog::V1::Entry Entry}. + # The {::Google::Cloud::DataCatalog::V1::Tag#column columns} in the response are + # lowercased. + # + # @overload list_tags(request, options = nil) + # Pass arguments to `list_tags` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_tags(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the Data Catalog resource to list the tags of. + # + # The resource can be an {::Google::Cloud::DataCatalog::V1::Entry Entry} + # or an {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup} + # (without `/entries/{entries}` at the end). + # @param page_size [::Integer] + # The maximum number of tags to return. Default is 10. Maximum limit is 1000. + # @param page_token [::String] + # Pagination token that specifies the next page to return. If empty, the + # first page is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListTagsRequest.new + # + # # Call the list_tags method. + # result = client.list_tags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag. + # p item + # end + # + def list_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTagsRequest + + # Converts hash and nil to 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_tags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_tags.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :list_tags, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @data_catalog_stub, :list_tags, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `ReconcileTags` creates or updates a list of tags on the entry. + # If the + # {::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest#force_delete_missing ReconcileTagsRequest.force_delete_missing} + # parameter is set, the operation deletes tags not included in the input tag + # list. + # + # `ReconcileTags` returns a [long-running operation] + # [google.longrunning.Operation] resource that can be queried with + # Operations.GetOperation + # to return [ReconcileTagsMetadata] + # [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and + # a [ReconcileTagsResponse] + # [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. + # + # @overload reconcile_tags(request, options = nil) + # Pass arguments to `reconcile_tags` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reconcile_tags(parent: nil, tag_template: nil, force_delete_missing: nil, tags: nil) + # Pass arguments to `reconcile_tags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of {::Google::Cloud::DataCatalog::V1::Entry Entry} to be tagged. + # @param tag_template [::String] + # Required. The name of the tag template, which is used for reconciliation. + # @param force_delete_missing [::Boolean] + # If set to `true`, deletes entry tags related to a tag template + # not listed in the tags source from an entry. If set to `false`, + # unlisted tags are retained. + # @param tags [::Array<::Google::Cloud::DataCatalog::V1::Tag, ::Hash>] + # A list of tags to apply to an entry. A tag can specify a + # tag template, which must be the template specified in the + # `ReconcileTagsRequest`. + # The sole entry and each of its columns must be mentioned at most once. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new + # + # # Call the reconcile_tags method. + # result = client.reconcile_tags request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reconcile_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reconcile_tags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reconcile_tags.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reconcile_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :reconcile_tags, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as starred by + # the current user. Starring information is private to each user. + # + # @overload star_entry(request, options = nil) + # Pass arguments to `star_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::StarEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::StarEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload star_entry(name: nil) + # Pass arguments to `star_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to mark as starred. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::StarEntryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::StarEntryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::StarEntryRequest.new + # + # # Call the star_entry method. + # result = client.star_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::StarEntryResponse. + # p result + # + def star_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::StarEntryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.star_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.star_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.star_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :star_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as NOT starred by + # the current user. Starring information is private to each user. + # + # @overload unstar_entry(request, options = nil) + # Pass arguments to `unstar_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UnstarEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UnstarEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload unstar_entry(name: nil) + # Pass arguments to `unstar_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to mark as **not** starred. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new + # + # # Call the unstar_entry method. + # result = client.unstar_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::UnstarEntryResponse. + # p result + # + def unstar_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.unstar_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.unstar_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.unstar_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :unstar_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets an access control policy for a resource. Replaces any existing + # policy. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method sets policies only within Data Catalog and can't be + # used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any + # external Google Cloud Platform resources synced with the Data Catalog. + # + # To call this method, you must have the following Google IAM permissions: + # + # - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag + # templates. + # - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # + # May return: + # + # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the + # permission to view it. + # * An empty policy if the resource exists but doesn't have a set policy. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method doesn't get policies from Google Cloud Platform + # resources ingested into Data Catalog. + # + # To call this method, you must have the following Google IAM permissions: + # + # - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag + # templates. + # - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets your permissions on a resource. + # + # Returns an empty set of permissions if the resource doesn't exist. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method gets policies only within Data Catalog and can't be + # used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any + # external Google Cloud Platform resources ingested into Data Catalog. + # + # No Google IAM permissions are required to call this method. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports entries from a source, such as data previously dumped into a + # Cloud Storage bucket, into Data Catalog. Import of entries + # is a sync operation that reconciles the state of the third-party system + # with the Data Catalog. + # + # `ImportEntries` accepts source data snapshots of a third-party system. + # Snapshot should be delivered as a .wire or base65-encoded .txt file + # containing a sequence of Protocol Buffer messages of + # {::Google::Cloud::DataCatalog::V1::DumpItem DumpItem} type. + # + # `ImportEntries` returns a [long-running operation] + # [google.longrunning.Operation] resource that can be queried with + # Operations.GetOperation + # to return + # {::Google::Cloud::DataCatalog::V1::ImportEntriesMetadata ImportEntriesMetadata} + # and an + # {::Google::Cloud::DataCatalog::V1::ImportEntriesResponse ImportEntriesResponse} + # message. + # + # @overload import_entries(request, options = nil) + # Pass arguments to `import_entries` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ImportEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ImportEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_entries(parent: nil, gcs_bucket_path: nil, job_id: nil) + # Pass arguments to `import_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Target entry group for ingested entries. + # @param gcs_bucket_path [::String] + # Path to a Cloud Storage bucket that contains a dump ready for ingestion. + # @param job_id [::String] + # Optional. (Optional) Dataplex task job id, if specified will be used as + # part of ImportEntries LRO ID + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new + # + # # Call the import_entries method. + # result = client.import_entries request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_entries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :import_entries, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the configuration related to the migration to Dataplex for an + # organization or project. + # + # @overload set_config(request, options = nil) + # Pass arguments to `set_config` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::SetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::SetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_config(name: nil, tag_template_migration: nil, catalog_ui_experience: nil) + # Pass arguments to `set_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The organization or project whose config is being specified. + # @param tag_template_migration [::Google::Cloud::DataCatalog::V1::TagTemplateMigration] + # Opt-in status for the migration of Tag Templates to Dataplex. + # @param catalog_ui_experience [::Google::Cloud::DataCatalog::V1::CatalogUIExperience] + # Opt-in status for the UI switch to Dataplex. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::SetConfigRequest.new + # + # # Call the set_config method. + # result = client.set_config request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::MigrationConfig. + # p result + # + def set_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::SetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :set_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the configuration related to the migration from Data Catalog to + # Dataplex for a specific organization, including all the projects under it + # which have a separate configuration set. + # + # @overload retrieve_config(request, options = nil) + # Pass arguments to `retrieve_config` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload retrieve_config(name: nil) + # Pass arguments to `retrieve_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The organization whose config is being retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::OrganizationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::OrganizationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new + # + # # Call the retrieve_config method. + # result = client.retrieve_config request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::OrganizationConfig. + # p result + # + def retrieve_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.retrieve_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.retrieve_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.retrieve_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :retrieve_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the effective configuration related to the migration from Data + # Catalog to Dataplex for a specific organization or project. If there is no + # specific configuration set for the resource, the setting is checked + # hierarchicahlly through the ancestors of the resource, starting from the + # resource itself. + # + # @overload retrieve_effective_config(request, options = nil) + # Pass arguments to `retrieve_effective_config` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload retrieve_effective_config(name: nil) + # Pass arguments to `retrieve_effective_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource whose effective config is being retrieved. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new + # + # # Call the retrieve_effective_config method. + # result = client.retrieve_effective_config request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::MigrationConfig. + # p result + # + def retrieve_effective_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.retrieve_effective_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.retrieve_effective_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.retrieve_effective_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.call_rpc :retrieve_effective_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DataCatalog API. + # + # This class represents the configuration for DataCatalog, + # providing control 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::DataCatalog::V1::DataCatalog::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # search_catalog to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search_catalog.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search_catalog.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DataCatalog API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `search_catalog` + # @return [::Gapic::Config::Method] + # + attr_reader :search_catalog + ## + # RPC-specific configuration for `create_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entry_group + ## + # RPC-specific configuration for `get_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entry_group + ## + # RPC-specific configuration for `update_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entry_group + ## + # RPC-specific configuration for `delete_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entry_group + ## + # RPC-specific configuration for `list_entry_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entry_groups + ## + # RPC-specific configuration for `create_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entry + ## + # RPC-specific configuration for `update_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entry + ## + # RPC-specific configuration for `delete_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entry + ## + # RPC-specific configuration for `get_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entry + ## + # RPC-specific configuration for `lookup_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup_entry + ## + # RPC-specific configuration for `list_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entries + ## + # RPC-specific configuration for `modify_entry_overview` + # @return [::Gapic::Config::Method] + # + attr_reader :modify_entry_overview + ## + # RPC-specific configuration for `modify_entry_contacts` + # @return [::Gapic::Config::Method] + # + attr_reader :modify_entry_contacts + ## + # RPC-specific configuration for `create_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_template + ## + # RPC-specific configuration for `get_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tag_template + ## + # RPC-specific configuration for `update_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_template + ## + # RPC-specific configuration for `delete_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_template + ## + # RPC-specific configuration for `create_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_template_field + ## + # RPC-specific configuration for `update_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_template_field + ## + # RPC-specific configuration for `rename_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :rename_tag_template_field + ## + # RPC-specific configuration for `rename_tag_template_field_enum_value` + # @return [::Gapic::Config::Method] + # + attr_reader :rename_tag_template_field_enum_value + ## + # RPC-specific configuration for `delete_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_template_field + ## + # RPC-specific configuration for `create_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag + ## + # RPC-specific configuration for `update_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag + ## + # RPC-specific configuration for `delete_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag + ## + # RPC-specific configuration for `list_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tags + ## + # RPC-specific configuration for `reconcile_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :reconcile_tags + ## + # RPC-specific configuration for `star_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :star_entry + ## + # RPC-specific configuration for `unstar_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :unstar_entry + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `import_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :import_entries + ## + # RPC-specific configuration for `set_config` + # @return [::Gapic::Config::Method] + # + attr_reader :set_config + ## + # RPC-specific configuration for `retrieve_config` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_config + ## + # RPC-specific configuration for `retrieve_effective_config` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_effective_config + + # @private + def initialize parent_rpcs = nil + search_catalog_config = parent_rpcs.search_catalog if parent_rpcs.respond_to? :search_catalog + @search_catalog = ::Gapic::Config::Method.new search_catalog_config + create_entry_group_config = parent_rpcs.create_entry_group if parent_rpcs.respond_to? :create_entry_group + @create_entry_group = ::Gapic::Config::Method.new create_entry_group_config + get_entry_group_config = parent_rpcs.get_entry_group if parent_rpcs.respond_to? :get_entry_group + @get_entry_group = ::Gapic::Config::Method.new get_entry_group_config + update_entry_group_config = parent_rpcs.update_entry_group if parent_rpcs.respond_to? :update_entry_group + @update_entry_group = ::Gapic::Config::Method.new update_entry_group_config + delete_entry_group_config = parent_rpcs.delete_entry_group if parent_rpcs.respond_to? :delete_entry_group + @delete_entry_group = ::Gapic::Config::Method.new delete_entry_group_config + list_entry_groups_config = parent_rpcs.list_entry_groups if parent_rpcs.respond_to? :list_entry_groups + @list_entry_groups = ::Gapic::Config::Method.new list_entry_groups_config + create_entry_config = parent_rpcs.create_entry if parent_rpcs.respond_to? :create_entry + @create_entry = ::Gapic::Config::Method.new create_entry_config + update_entry_config = parent_rpcs.update_entry if parent_rpcs.respond_to? :update_entry + @update_entry = ::Gapic::Config::Method.new update_entry_config + delete_entry_config = parent_rpcs.delete_entry if parent_rpcs.respond_to? :delete_entry + @delete_entry = ::Gapic::Config::Method.new delete_entry_config + get_entry_config = parent_rpcs.get_entry if parent_rpcs.respond_to? :get_entry + @get_entry = ::Gapic::Config::Method.new get_entry_config + lookup_entry_config = parent_rpcs.lookup_entry if parent_rpcs.respond_to? :lookup_entry + @lookup_entry = ::Gapic::Config::Method.new lookup_entry_config + list_entries_config = parent_rpcs.list_entries if parent_rpcs.respond_to? :list_entries + @list_entries = ::Gapic::Config::Method.new list_entries_config + modify_entry_overview_config = parent_rpcs.modify_entry_overview if parent_rpcs.respond_to? :modify_entry_overview + @modify_entry_overview = ::Gapic::Config::Method.new modify_entry_overview_config + modify_entry_contacts_config = parent_rpcs.modify_entry_contacts if parent_rpcs.respond_to? :modify_entry_contacts + @modify_entry_contacts = ::Gapic::Config::Method.new modify_entry_contacts_config + create_tag_template_config = parent_rpcs.create_tag_template if parent_rpcs.respond_to? :create_tag_template + @create_tag_template = ::Gapic::Config::Method.new create_tag_template_config + get_tag_template_config = parent_rpcs.get_tag_template if parent_rpcs.respond_to? :get_tag_template + @get_tag_template = ::Gapic::Config::Method.new get_tag_template_config + update_tag_template_config = parent_rpcs.update_tag_template if parent_rpcs.respond_to? :update_tag_template + @update_tag_template = ::Gapic::Config::Method.new update_tag_template_config + delete_tag_template_config = parent_rpcs.delete_tag_template if parent_rpcs.respond_to? :delete_tag_template + @delete_tag_template = ::Gapic::Config::Method.new delete_tag_template_config + create_tag_template_field_config = parent_rpcs.create_tag_template_field if parent_rpcs.respond_to? :create_tag_template_field + @create_tag_template_field = ::Gapic::Config::Method.new create_tag_template_field_config + update_tag_template_field_config = parent_rpcs.update_tag_template_field if parent_rpcs.respond_to? :update_tag_template_field + @update_tag_template_field = ::Gapic::Config::Method.new update_tag_template_field_config + rename_tag_template_field_config = parent_rpcs.rename_tag_template_field if parent_rpcs.respond_to? :rename_tag_template_field + @rename_tag_template_field = ::Gapic::Config::Method.new rename_tag_template_field_config + rename_tag_template_field_enum_value_config = parent_rpcs.rename_tag_template_field_enum_value if parent_rpcs.respond_to? :rename_tag_template_field_enum_value + @rename_tag_template_field_enum_value = ::Gapic::Config::Method.new rename_tag_template_field_enum_value_config + delete_tag_template_field_config = parent_rpcs.delete_tag_template_field if parent_rpcs.respond_to? :delete_tag_template_field + @delete_tag_template_field = ::Gapic::Config::Method.new delete_tag_template_field_config + create_tag_config = parent_rpcs.create_tag if parent_rpcs.respond_to? :create_tag + @create_tag = ::Gapic::Config::Method.new create_tag_config + update_tag_config = parent_rpcs.update_tag if parent_rpcs.respond_to? :update_tag + @update_tag = ::Gapic::Config::Method.new update_tag_config + delete_tag_config = parent_rpcs.delete_tag if parent_rpcs.respond_to? :delete_tag + @delete_tag = ::Gapic::Config::Method.new delete_tag_config + list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags + @list_tags = ::Gapic::Config::Method.new list_tags_config + reconcile_tags_config = parent_rpcs.reconcile_tags if parent_rpcs.respond_to? :reconcile_tags + @reconcile_tags = ::Gapic::Config::Method.new reconcile_tags_config + star_entry_config = parent_rpcs.star_entry if parent_rpcs.respond_to? :star_entry + @star_entry = ::Gapic::Config::Method.new star_entry_config + unstar_entry_config = parent_rpcs.unstar_entry if parent_rpcs.respond_to? :unstar_entry + @unstar_entry = ::Gapic::Config::Method.new unstar_entry_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + import_entries_config = parent_rpcs.import_entries if parent_rpcs.respond_to? :import_entries + @import_entries = ::Gapic::Config::Method.new import_entries_config + set_config_config = parent_rpcs.set_config if parent_rpcs.respond_to? :set_config + @set_config = ::Gapic::Config::Method.new set_config_config + retrieve_config_config = parent_rpcs.retrieve_config if parent_rpcs.respond_to? :retrieve_config + @retrieve_config = ::Gapic::Config::Method.new retrieve_config_config + retrieve_effective_config_config = parent_rpcs.retrieve_effective_config if parent_rpcs.respond_to? :retrieve_effective_config + @retrieve_effective_config = ::Gapic::Config::Method.new retrieve_effective_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/credentials.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/credentials.rb new file mode 100644 index 000000000000..4b72219e1704 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + # Credentials for the DataCatalog API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATA_CATALOG_CREDENTIALS", + "DATA_CATALOG_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATA_CATALOG_CREDENTIALS_JSON", + "DATA_CATALOG_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-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/operations.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/operations.rb new file mode 100644 index 000000000000..7d4e0de48c2d --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/operations.rb @@ -0,0 +1,806 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DataCatalog Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DataCatalog Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/paths.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/paths.rb new file mode 100644 index 000000000000..aed28a83b607 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/paths.rb @@ -0,0 +1,176 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + # Path helper methods for the DataCatalog API. + module Paths + ## + # Create a fully-qualified Entry resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}` + # + # @param project [String] + # @param location [String] + # @param entry_group [String] + # @param entry [String] + # + # @return [::String] + def entry_path project:, location:, entry_group:, entry: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "entry_group cannot contain /" if entry_group.to_s.include? "/" + + "projects/#{project}/locations/#{location}/entryGroups/#{entry_group}/entries/#{entry}" + end + + ## + # Create a fully-qualified EntryGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/entryGroups/{entry_group}` + # + # @param project [String] + # @param location [String] + # @param entry_group [String] + # + # @return [::String] + def entry_group_path project:, location:, entry_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/entryGroups/#{entry_group}" + 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 Tag resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}` + # + # @param project [String] + # @param location [String] + # @param entry_group [String] + # @param entry [String] + # @param tag [String] + # + # @return [::String] + def tag_path project:, location:, entry_group:, entry:, tag: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "entry_group cannot contain /" if entry_group.to_s.include? "/" + raise ::ArgumentError, "entry cannot contain /" if entry.to_s.include? "/" + + "projects/#{project}/locations/#{location}/entryGroups/#{entry_group}/entries/#{entry}/tags/#{tag}" + end + + ## + # Create a fully-qualified TagTemplate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tagTemplates/{tag_template}` + # + # @param project [String] + # @param location [String] + # @param tag_template [String] + # + # @return [::String] + def tag_template_path project:, location:, tag_template: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tagTemplates/#{tag_template}" + end + + ## + # Create a fully-qualified TagTemplateField resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}` + # + # @param project [String] + # @param location [String] + # @param tag_template [String] + # @param field [String] + # + # @return [::String] + def tag_template_field_path project:, location:, tag_template:, field: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "tag_template cannot contain /" if tag_template.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tagTemplates/#{tag_template}/fields/#{field}" + end + + ## + # Create a fully-qualified TagTemplateFieldEnumValue resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}` + # + # @param project [String] + # @param location [String] + # @param tag_template [String] + # @param tag_template_field_id [String] + # @param enum_value_display_name [String] + # + # @return [::String] + def tag_template_field_enum_value_path project:, location:, tag_template:, tag_template_field_id:, enum_value_display_name: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "tag_template cannot contain /" if tag_template.to_s.include? "/" + raise ::ArgumentError, "tag_template_field_id cannot contain /" if tag_template_field_id.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tagTemplates/#{tag_template}/fields/#{tag_template_field_id}/enumValues/#{enum_value_display_name}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest.rb new file mode 100644 index 000000000000..e504a5f27cd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/data_catalog/v1/version" + +require "google/cloud/data_catalog/v1/data_catalog/credentials" +require "google/cloud/data_catalog/v1/data_catalog/paths" +require "google/cloud/data_catalog/v1/data_catalog/rest/operations" +require "google/cloud/data_catalog/v1/data_catalog/rest/client" + +module Google + module Cloud + module DataCatalog + module V1 + ## + # Data Catalog API service allows you to discover, understand, and manage + # your data. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/data_catalog/v1/data_catalog/rest" + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + module DataCatalog + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/data_catalog/v1/data_catalog/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb new file mode 100644 index 000000000000..7b8e33c11181 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/client.rb @@ -0,0 +1,4103 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/datacatalog/v1/datacatalog_pb" +require "google/cloud/data_catalog/v1/data_catalog/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + module Rest + ## + # REST client for the DataCatalog service. + # + # Data Catalog API service allows you to discover, understand, and manage + # your data. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :data_catalog_stub + + ## + # Configure the DataCatalog Client class. + # + # See {::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DataCatalog clients + # ::Google::Cloud::DataCatalog::V1::DataCatalog::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", "DataCatalog", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 8, 13] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DataCatalog 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::DataCatalog::V1::DataCatalog::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @data_catalog_stub.universe_domain + end + + ## + # Create a new DataCatalog REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DataCatalog client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @data_catalog_stub = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @data_catalog_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_catalog_stub.endpoint + config.universe_domain = @data_catalog_stub.universe_domain + config.logger = @data_catalog_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @data_catalog_stub.logger + end + + # Service calls + + ## + # Searches Data Catalog for multiple resources like entries and tags that + # match a query. + # + # This is a [Custom Method] + # (https://cloud.google.com/apis/design/custom_methods) that doesn't return + # all information on a resource, only its ID and high level fields. To get + # more information, you can subsequently call specific get methods. + # + # Note: Data Catalog search queries don't guarantee full recall. Results + # that match your query might not be returned, even in subsequent + # result pages. Additionally, returned (and not returned) results can vary + # if you repeat search queries. + # + # For more information, see [Data Catalog search syntax] + # (https://cloud.google.com/data-catalog/docs/how-to/search-reference). + # + # @overload search_catalog(request, options = nil) + # Pass arguments to `search_catalog` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::SearchCatalogRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_catalog(scope: nil, query: nil, page_size: nil, page_token: nil, order_by: nil, admin_search: nil) + # Pass arguments to `search_catalog` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param scope [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope, ::Hash] + # Required. The scope of this search request. + # + # The `scope` is invalid if `include_org_ids`, `include_project_ids` are + # empty AND `include_gcp_public_datasets` is set to `false`. In this case, + # the request returns an error. + # @param query [::String] + # Optional. The query string with a minimum of 3 characters and specific + # syntax. For more information, see [Data Catalog search + # syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). + # + # An empty query string returns all data assets (in the specified scope) + # that you have access to. + # + # A query string can be a simple `xyz` or qualified by predicates: + # + # * `name:x` + # * `column:y` + # * `description:z` + # @param page_size [::Integer] + # Upper bound on the number of results you can get in a single response. + # + # Can't be negative or 0, defaults to 10 in this case. + # The maximum number is 1000. If exceeded, throws an "invalid argument" + # exception. + # @param page_token [::String] + # Optional. Pagination token that, if specified, returns the next page of + # search results. If empty, returns the first page. + # + # This token is returned in the + # {::Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token} + # field of the response to a previous + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client#search_catalog SearchCatalogRequest} + # call. + # @param order_by [::String] + # Specifies the order of results. + # + # Currently supported case-sensitive values are: + # + # * `relevance` that can only be descending + # * `last_modified_timestamp [asc|desc]` with descending (`desc`) as default + # * `default` that can only be descending + # + # Search queries don't guarantee full recall. Results that match your query + # might not be returned, even in subsequent result pages. Additionally, + # returned (and not returned) results can vary if you repeat search queries. + # If you are experiencing recall issues and you don't have to fetch the + # results in any specific order, consider setting this parameter to + # `default`. + # + # If this parameter is omitted, it defaults to the descending `relevance`. + # @param admin_search [::Boolean] + # Optional. If set, use searchAll permission granted on organizations from + # `include_org_ids` and projects from `include_project_ids` instead of the + # fine grained per resource permissions when filtering the search results. + # The only allowed `order_by` criteria for admin_search mode is `default`. + # Using this flags guarantees a full recall of the search results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::SearchCatalogResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::SearchCatalogResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new + # + # # Call the search_catalog method. + # result = client.search_catalog request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult. + # p item + # end + # + def search_catalog request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.search_catalog.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_catalog.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_catalog.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.search_catalog request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an entry group. + # + # An entry group contains logically related entries together with [Cloud + # Identity and Access Management](/data-catalog/docs/concepts/iam) policies. + # These policies specify users who can create, edit, and view entries + # within entry groups. + # + # Data Catalog automatically creates entry groups with names that start with + # the `@` symbol for the following resources: + # + # * BigQuery entries (`@bigquery`) + # * Pub/Sub topics (`@pubsub`) + # * Dataproc Metastore services (`@dataproc_metastore_{SERVICE_NAME_HASH}`) + # + # You can create your own entry groups for Cloud Storage fileset entries + # and custom entries together with the corresponding IAM policies. + # User-created entry groups can't contain the `@` symbol, it is reserved + # for automatically created groups. + # + # Entry groups, like entries, can be searched. + # + # A maximum of 10,000 entry groups may be created per organization across all + # locations. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload create_entry_group(request, options = nil) + # Pass arguments to `create_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_entry_group(parent: nil, entry_group_id: nil, entry_group: nil) + # Pass arguments to `create_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The names of the project and location that the new entry group + # belongs to. + # + # Note: The entry group itself and its child resources might not be + # stored in the location specified in its name. + # @param entry_group_id [::String] + # Required. The ID of the entry group to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and must start with a letter or underscore. + # The maximum size is 64 bytes when encoded in UTF-8. + # @param entry_group [::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash] + # The entry group to create. Defaults to empty. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new + # + # # Call the create_entry_group method. + # result = client.create_entry_group request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + # p result + # + def create_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest + + # Converts hash and nil to an 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_entry_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.create_entry_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an entry group. + # + # @overload get_entry_group(request, options = nil) + # Pass arguments to `get_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_entry_group(name: nil, read_mask: nil) + # Pass arguments to `get_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry group to get. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields to return. If empty or omitted, all fields are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new + # + # # Call the get_entry_group method. + # result = client.get_entry_group request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + # p result + # + def get_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest + + # Converts hash and nil to an 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_entry_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.get_entry_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an entry group. + # + # You must enable the Data Catalog API in the project identified by + # the `entry_group.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_entry_group(request, options = nil) + # Pass arguments to `update_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entry_group(entry_group: nil, update_mask: nil) + # Pass arguments to `update_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entry_group [::Google::Cloud::DataCatalog::V1::EntryGroup, ::Hash] + # Required. Updates for the entry group. The `name` field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on an entry group. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new + # + # # Call the update_entry_group method. + # result = client.update_entry_group request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + # p result + # + def update_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest + + # Converts hash and nil to an 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_entry_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.update_entry_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an entry group. + # + # You must enable the Data Catalog API in the project + # identified by the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_entry_group(request, options = nil) + # Pass arguments to `delete_entry_group` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_entry_group(name: nil, force: nil) + # Pass arguments to `delete_entry_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry group to delete. + # @param force [::Boolean] + # Optional. If true, deletes all entries in the entry group. + # @yield [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/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new + # + # # Call the delete_entry_group method. + # result = client.delete_entry_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_entry_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest + + # Converts hash and nil to an 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_entry_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_entry_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_entry_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.delete_entry_group request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists entry groups. + # + # @overload list_entry_groups(request, options = nil) + # Pass arguments to `list_entry_groups` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_entry_groups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_entry_groups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the location that contains the entry groups to list. + # + # Can be provided as a URL. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # Default is 10. Maximum limit is 1000. + # Throws an invalid argument if `page_size` is greater than 1000. + # @param page_token [::String] + # Optional. Pagination token that specifies the next page to return. + # If empty, returns the first page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::EntryGroup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.new + # + # # Call the list_entry_groups method. + # result = client.list_entry_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup. + # p item + # end + # + def list_entry_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest + + # Converts hash and nil to an 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_entry_groups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_entry_groups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_entry_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.list_entry_groups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @data_catalog_stub, :list_entry_groups, "entry_groups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an entry. + # + # You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', + # or custom types. Data Catalog automatically creates entries with other + # types during metadata ingestion from integrated systems. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # An entry group can have a maximum of 100,000 entries. + # + # @overload create_entry(request, options = nil) + # Pass arguments to `create_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_entry(parent: nil, entry_id: nil, entry: nil) + # Pass arguments to `create_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the entry group this entry belongs to. + # + # Note: The entry itself and its child resources might not be stored in + # the location specified in its name. + # @param entry_id [::String] + # Required. The ID of the entry to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # and underscores (_). + # The maximum size is 64 bytes when encoded in UTF-8. + # @param entry [::Google::Cloud::DataCatalog::V1::Entry, ::Hash] + # Required. The entry to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateEntryRequest.new + # + # # Call the create_entry method. + # result = client.create_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def create_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateEntryRequest + + # Converts hash and nil to an 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.create_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing entry. + # + # You must enable the Data Catalog API in the project identified by + # the `entry.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_entry(request, options = nil) + # Pass arguments to `update_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entry(entry: nil, update_mask: nil) + # Pass arguments to `update_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entry [::Google::Cloud::DataCatalog::V1::Entry, ::Hash] + # Required. Updates for the entry. The `name` field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on an entry. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # You can modify only the fields listed below. + # + # For entries with type `DATA_STREAM`: + # + # * `schema` + # + # For entries with type `FILESET`: + # + # * `schema` + # * `display_name` + # * `description` + # * `gcs_fileset_spec` + # * `gcs_fileset_spec.file_patterns` + # + # For entries with `user_specified_type`: + # + # * `schema` + # * `display_name` + # * `description` + # * `user_specified_type` + # * `user_specified_system` + # * `linked_resource` + # * `source_system_timestamps` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new + # + # # Call the update_entry method. + # result = client.update_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def update_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest + + # Converts hash and nil to an 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.update_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an existing entry. + # + # You can delete only the entries created by the + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client#create_entry CreateEntry} + # method. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_entry(request, options = nil) + # Pass arguments to `delete_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_entry(name: nil) + # Pass arguments to `delete_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new + # + # # Call the delete_entry method. + # result = client.delete_entry request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest + + # Converts hash and nil to an 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.delete_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an entry. + # + # @overload get_entry(request, options = nil) + # Pass arguments to `get_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_entry(name: nil) + # Pass arguments to `get_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetEntryRequest.new + # + # # Call the get_entry method. + # result = client.get_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def get_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetEntryRequest + + # Converts hash and nil to an 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_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.get_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an entry by its target resource name. + # + # The resource name comes from the source Google Cloud Platform service. + # + # @overload lookup_entry(request, options = nil) + # Pass arguments to `lookup_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::LookupEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::LookupEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload lookup_entry(linked_resource: nil, sql_resource: nil, fully_qualified_name: nil, project: nil, location: nil) + # Pass arguments to `lookup_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param linked_resource [::String] + # The full name of the Google Cloud Platform resource the Data Catalog + # entry represents. For more information, see [Full Resource Name] + # (https://cloud.google.com/apis/design/resource_names#full_resource_name). + # + # Full names are case-sensitive. For example: + # + # * `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}` + # * `//pubsub.googleapis.com/projects/{PROJECT_ID}/topics/{TOPIC_ID}` + # @param sql_resource [::String] + # The SQL name of the entry. SQL names are case-sensitive. + # + # Examples: + # + # * `pubsub.topic.{PROJECT_ID}.{TOPIC_ID}` + # * `pubsub.topic.{PROJECT_ID}.`\``{TOPIC.ID.SEPARATED.WITH.DOTS}`\` + # * `bigquery.table.{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}` + # * `bigquery.dataset.{PROJECT_ID}.{DATASET_ID}` + # * `datacatalog.entry.{PROJECT_ID}.{LOCATION_ID}.{ENTRY_GROUP_ID}.{ENTRY_ID}` + # + # Identifiers (`*_ID`) should comply with the + # [Lexical structure in Standard SQL] + # (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical). + # @param fully_qualified_name [::String] + # [Fully Qualified Name + # (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + # of the resource. + # + # FQNs take two forms: + # + # * For non-regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # * For regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # Example for a DPMS table: + # + # `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` + # @param project [::String] + # Project where the lookup should be performed. Required to lookup + # entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + # using its `fully_qualified_name`. Ignored in other cases. + # @param location [::String] + # Location where the lookup should be performed. Required to lookup + # entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + # using its `fully_qualified_name`. Ignored in other cases. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::LookupEntryRequest.new + # + # # Call the lookup_entry method. + # result = client.lookup_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + # p result + # + def lookup_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::LookupEntryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.lookup_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.lookup_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.lookup_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.lookup_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists entries. + # + # Note: Currently, this method can list only custom entries. + # To get a list of both custom and automatically created entries, use + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client#search_catalog SearchCatalog}. + # + # @overload list_entries(request, options = nil) + # Pass arguments to `list_entries` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_entries(parent: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the entry group that contains the entries to list. + # + # Can be provided in URL format. + # @param page_size [::Integer] + # The maximum number of items to return. Default is 10. Maximum limit is + # 1000. Throws an invalid argument if `page_size` is more than 1000. + # @param page_token [::String] + # Pagination token that specifies the next page to return. If empty, the + # first page is returned. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields to return for each entry. If empty or omitted, all + # fields are returned. + # + # For example, to return a list of entries with only the `name` field, + # set `read_mask` to only one path with the `name` value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Entry>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListEntriesRequest.new + # + # # Call the list_entries method. + # result = client.list_entries request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry. + # p item + # end + # + def list_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListEntriesRequest + + # Converts hash and nil to an 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_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_entries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.list_entries request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @data_catalog_stub, :list_entries, "entries", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Modifies entry overview, part of the business context of an + # {::Google::Cloud::DataCatalog::V1::Entry Entry}. + # + # To call this method, you must have the `datacatalog.entries.updateOverview` + # IAM permission on the corresponding project. + # + # @overload modify_entry_overview(request, options = nil) + # Pass arguments to `modify_entry_overview` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload modify_entry_overview(name: nil, entry_overview: nil) + # Pass arguments to `modify_entry_overview` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the entry. + # @param entry_overview [::Google::Cloud::DataCatalog::V1::EntryOverview, ::Hash] + # Required. The new value for the Entry Overview. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryOverview] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryOverview] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new + # + # # Call the modify_entry_overview method. + # result = client.modify_entry_overview request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::EntryOverview. + # p result + # + def modify_entry_overview request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.modify_entry_overview.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.modify_entry_overview.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.modify_entry_overview.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.modify_entry_overview request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Modifies contacts, part of the business context of an + # {::Google::Cloud::DataCatalog::V1::Entry Entry}. + # + # To call this method, you must have the `datacatalog.entries.updateContacts` + # IAM permission on the corresponding project. + # + # @overload modify_entry_contacts(request, options = nil) + # Pass arguments to `modify_entry_contacts` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload modify_entry_contacts(name: nil, contacts: nil) + # Pass arguments to `modify_entry_contacts` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the entry. + # @param contacts [::Google::Cloud::DataCatalog::V1::Contacts, ::Hash] + # Required. The new value for the Contacts. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Contacts] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Contacts] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new + # + # # Call the modify_entry_contacts method. + # result = client.modify_entry_contacts request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Contacts. + # p result + # + def modify_entry_contacts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.modify_entry_contacts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.modify_entry_contacts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.modify_entry_contacts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.modify_entry_contacts request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a tag template. + # + # You must enable the Data Catalog API in the project identified by the + # `parent` parameter. + # For more information, see [Data Catalog resource project] + # (https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload create_tag_template(request, options = nil) + # Pass arguments to `create_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_tag_template(parent: nil, tag_template_id: nil, tag_template: nil) + # Pass arguments to `create_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project and the template location + # [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + # @param tag_template_id [::String] + # Required. The ID of the tag template to create. + # + # The ID must contain only lowercase letters (a-z), numbers (0-9), + # or underscores (_), and must start with a letter or underscore. + # The maximum size is 64 bytes when encoded in UTF-8. + # @param tag_template [::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash] + # Required. The tag template to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new + # + # # Call the create_tag_template method. + # result = client.create_tag_template request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + # p result + # + def create_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest + + # Converts hash and nil to an 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_tag_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.create_tag_template request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a tag template. + # + # @overload get_tag_template(request, options = nil) + # Pass arguments to `get_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_tag_template(name: nil) + # Pass arguments to `get_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new + # + # # Call the get_tag_template method. + # result = client.get_tag_template request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + # p result + # + def get_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest + + # Converts hash and nil to an 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_tag_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.get_tag_template request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a tag template. + # + # You can't update template fields with this method. These fields are + # separate resources with their own create, update, and delete methods. + # + # You must enable the Data Catalog API in the project identified by + # the `tag_template.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_tag_template(request, options = nil) + # Pass arguments to `update_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_template(tag_template: nil, update_mask: nil) + # Pass arguments to `update_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag_template [::Google::Cloud::DataCatalog::V1::TagTemplate, ::Hash] + # Required. The template to update. The `name` field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on a tag template. Currently, + # only `display_name` and `is_publicly_readable` can be overwritten. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # Note: Updating the `is_publicly_readable` field may require up to 12 + # hours to take effect in search results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new + # + # # Call the update_tag_template method. + # result = client.update_tag_template request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + # p result + # + def update_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest + + # Converts hash and nil to an 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_tag_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.update_tag_template request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a tag template and all tags that use it. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_tag_template(request, options = nil) + # Pass arguments to `delete_tag_template` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_tag_template(name: nil, force: nil) + # Pass arguments to `delete_tag_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template to delete. + # @param force [::Boolean] + # Required. If true, deletes all tags that use this template. + # + # Currently, `true` is the only supported value. + # @yield [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/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new + # + # # Call the delete_tag_template method. + # result = client.delete_tag_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tag_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest + + # Converts hash and nil to an 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_tag_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_tag_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.delete_tag_template request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a field in a tag template. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload create_tag_template_field(request, options = nil) + # Pass arguments to `create_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_tag_template_field(parent: nil, tag_template_field_id: nil, tag_template_field: nil) + # Pass arguments to `create_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the project and the template location + # [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + # @param tag_template_field_id [::String] + # Required. The ID of the tag template field to create. + # + # Note: Adding a required field to an existing template is *not* allowed. + # + # Field IDs can contain letters (both uppercase and lowercase), numbers + # (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 + # character long and at most 128 characters long. Field IDs must also be + # unique within their template. + # @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash] + # Required. The tag template field to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new + # + # # Call the create_tag_template_field method. + # result = client.create_tag_template_field request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def create_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest + + # Converts hash and nil to an 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_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_tag_template_field.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.create_tag_template_field request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a field in a tag template. + # + # You can't update the field type with this method. + # + # You must enable the Data Catalog API in the project + # identified by the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload update_tag_template_field(request, options = nil) + # Pass arguments to `update_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag_template_field(name: nil, tag_template_field: nil, update_mask: nil) + # Pass arguments to `update_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template field. + # @param tag_template_field [::Google::Cloud::DataCatalog::V1::TagTemplateField, ::Hash] + # Required. The template to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Names of fields whose values to overwrite on an individual field + # of a tag template. The following fields are modifiable: + # + # * `display_name` + # * `type.enum_type` + # * `is_required` + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the request + # body, their values are emptied with one exception: when updating an enum + # type, the provided values are merged with the existing values. Therefore, + # enum values can only be added, existing enum values cannot be deleted or + # renamed. + # + # Additionally, updating a template field from optional to required is + # *not* allowed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new + # + # # Call the update_tag_template_field method. + # result = client.update_tag_template_field request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def update_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest + + # Converts hash and nil to an 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_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_tag_template_field.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.update_tag_template_field request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renames a field in a tag template. + # + # You must enable the Data Catalog API in the project identified by the + # `name` parameter. For more information, see [Data Catalog resource project] + # (https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload rename_tag_template_field(request, options = nil) + # Pass arguments to `rename_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload rename_tag_template_field(name: nil, new_tag_template_field_id: nil) + # Pass arguments to `rename_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template field. + # @param new_tag_template_field_id [::String] + # Required. The new ID of this tag template field. For example, + # `my_new_field`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new + # + # # Call the rename_tag_template_field method. + # result = client.rename_tag_template_field request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def rename_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.rename_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rename_tag_template_field.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rename_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.rename_tag_template_field request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renames an enum value in a tag template. + # + # Within a single enum field, enum values must be unique. + # + # @overload rename_tag_template_field_enum_value(request, options = nil) + # Pass arguments to `rename_tag_template_field_enum_value` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload rename_tag_template_field_enum_value(name: nil, new_enum_value_display_name: nil) + # Pass arguments to `rename_tag_template_field_enum_value` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the enum field value. + # @param new_enum_value_display_name [::String] + # Required. The new display name of the enum value. For example, + # `my_new_enum_value`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new + # + # # Call the rename_tag_template_field_enum_value method. + # result = client.rename_tag_template_field_enum_value request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + # p result + # + def rename_tag_template_field_enum_value request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.rename_tag_template_field_enum_value.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rename_tag_template_field_enum_value.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rename_tag_template_field_enum_value.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.rename_tag_template_field_enum_value request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a field in a tag template and all uses of this field from the tags + # based on this template. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # @overload delete_tag_template_field(request, options = nil) + # Pass arguments to `delete_tag_template_field` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_tag_template_field(name: nil, force: nil) + # Pass arguments to `delete_tag_template_field` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag template field to delete. + # @param force [::Boolean] + # Required. If true, deletes this field from any tags that use it. + # + # Currently, `true` is the only supported value. + # @yield [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/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new + # + # # Call the delete_tag_template_field method. + # result = client.delete_tag_template_field request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tag_template_field request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest + + # Converts hash and nil to an 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_tag_template_field.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_tag_template_field.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag_template_field.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.delete_tag_template_field request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a tag and assigns it to: + # + # * An {::Google::Cloud::DataCatalog::V1::Entry Entry} if the method name is + # `projects.locations.entryGroups.entries.tags.create`. + # * Or {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup}if the method + # name is `projects.locations.entryGroups.tags.create`. + # + # Note: The project identified by the `parent` parameter for the [tag] + # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) + # and the [tag template] + # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) + # used to create the tag must be in the same organization. + # + # @overload create_tag(request, options = nil) + # Pass arguments to `create_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_tag(parent: nil, tag: nil) + # Pass arguments to `create_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the resource to attach this tag to. + # + # Tags can be attached to entries or entry groups. An entry can have up to + # 1000 attached tags. + # + # Note: The tag and its child resources might not be stored in + # the location specified in its name. + # @param tag [::Google::Cloud::DataCatalog::V1::Tag, ::Hash] + # Required. The tag to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Tag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTagRequest.new + # + # # Call the create_tag method. + # result = client.create_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + # p result + # + def create_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTagRequest + + # Converts hash and nil to an 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_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.create_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an existing tag. + # + # @overload update_tag(request, options = nil) + # Pass arguments to `update_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tag(tag: nil, update_mask: nil) + # Pass arguments to `update_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tag [::Google::Cloud::DataCatalog::V1::Tag, ::Hash] + # Required. The updated tag. The "name" field must be set. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Names of fields whose values to overwrite on a tag. Currently, a tag has + # the only modifiable field with the name `fields`. + # + # In general, if this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Tag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTagRequest.new + # + # # Call the update_tag method. + # result = client.update_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + # p result + # + def update_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTagRequest + + # Converts hash and nil to an 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_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.update_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a tag. + # + # @overload delete_tag(request, options = nil) + # Pass arguments to `delete_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_tag(name: nil) + # Pass arguments to `delete_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the tag to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTagRequest.new + # + # # Call the delete_tag method. + # result = client.delete_tag request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTagRequest + + # Converts hash and nil to an 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_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.delete_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists tags assigned to an {::Google::Cloud::DataCatalog::V1::Entry Entry}. + # The {::Google::Cloud::DataCatalog::V1::Tag#column columns} in the response are + # lowercased. + # + # @overload list_tags(request, options = nil) + # Pass arguments to `list_tags` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_tags(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the Data Catalog resource to list the tags of. + # + # The resource can be an {::Google::Cloud::DataCatalog::V1::Entry Entry} + # or an {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup} + # (without `/entries/{entries}` at the end). + # @param page_size [::Integer] + # The maximum number of tags to return. Default is 10. Maximum limit is 1000. + # @param page_token [::String] + # Pagination token that specifies the next page to return. If empty, the + # first page is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Tag>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListTagsRequest.new + # + # # Call the list_tags method. + # result = client.list_tags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag. + # p item + # end + # + def list_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTagsRequest + + # Converts hash and nil to an 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_tags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_tags.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.list_tags request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @data_catalog_stub, :list_tags, "tags", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # `ReconcileTags` creates or updates a list of tags on the entry. + # If the + # {::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest#force_delete_missing ReconcileTagsRequest.force_delete_missing} + # parameter is set, the operation deletes tags not included in the input tag + # list. + # + # `ReconcileTags` returns a [long-running operation] + # [google.longrunning.Operation] resource that can be queried with + # Operations.GetOperation + # to return [ReconcileTagsMetadata] + # [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and + # a [ReconcileTagsResponse] + # [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. + # + # @overload reconcile_tags(request, options = nil) + # Pass arguments to `reconcile_tags` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reconcile_tags(parent: nil, tag_template: nil, force_delete_missing: nil, tags: nil) + # Pass arguments to `reconcile_tags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of {::Google::Cloud::DataCatalog::V1::Entry Entry} to be tagged. + # @param tag_template [::String] + # Required. The name of the tag template, which is used for reconciliation. + # @param force_delete_missing [::Boolean] + # If set to `true`, deletes entry tags related to a tag template + # not listed in the tags source from an entry. If set to `false`, + # unlisted tags are retained. + # @param tags [::Array<::Google::Cloud::DataCatalog::V1::Tag, ::Hash>] + # A list of tags to apply to an entry. A tag can specify a + # tag template, which must be the template specified in the + # `ReconcileTagsRequest`. + # The sole entry and each of its columns must be mentioned at most once. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new + # + # # Call the reconcile_tags method. + # result = client.reconcile_tags request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reconcile_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.reconcile_tags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.reconcile_tags.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reconcile_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.reconcile_tags request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as starred by + # the current user. Starring information is private to each user. + # + # @overload star_entry(request, options = nil) + # Pass arguments to `star_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::StarEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::StarEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload star_entry(name: nil) + # Pass arguments to `star_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to mark as starred. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::StarEntryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::StarEntryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::StarEntryRequest.new + # + # # Call the star_entry method. + # result = client.star_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::StarEntryResponse. + # p result + # + def star_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::StarEntryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.star_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.star_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.star_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.star_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Marks an {::Google::Cloud::DataCatalog::V1::Entry Entry} as NOT starred by + # the current user. Starring information is private to each user. + # + # @overload unstar_entry(request, options = nil) + # Pass arguments to `unstar_entry` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UnstarEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UnstarEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload unstar_entry(name: nil) + # Pass arguments to `unstar_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the entry to mark as **not** starred. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new + # + # # Call the unstar_entry method. + # result = client.unstar_entry request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::UnstarEntryResponse. + # p result + # + def unstar_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.unstar_entry.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.unstar_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.unstar_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.unstar_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets an access control policy for a resource. Replaces any existing + # policy. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method sets policies only within Data Catalog and can't be + # used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any + # external Google Cloud Platform resources synced with the Data Catalog. + # + # To call this method, you must have the following Google IAM permissions: + # + # - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag + # templates. + # - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # + # May return: + # + # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the + # permission to view it. + # * An empty policy if the resource exists but doesn't have a set policy. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method doesn't get policies from Google Cloud Platform + # resources ingested into Data Catalog. + # + # To call this method, you must have the following Google IAM permissions: + # + # - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag + # templates. + # - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets your permissions on a resource. + # + # Returns an empty set of permissions if the resource doesn't exist. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method gets policies only within Data Catalog and can't be + # used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any + # external Google Cloud Platform resources ingested into Data Catalog. + # + # No Google IAM permissions are required to call this method. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports entries from a source, such as data previously dumped into a + # Cloud Storage bucket, into Data Catalog. Import of entries + # is a sync operation that reconciles the state of the third-party system + # with the Data Catalog. + # + # `ImportEntries` accepts source data snapshots of a third-party system. + # Snapshot should be delivered as a .wire or base65-encoded .txt file + # containing a sequence of Protocol Buffer messages of + # {::Google::Cloud::DataCatalog::V1::DumpItem DumpItem} type. + # + # `ImportEntries` returns a [long-running operation] + # [google.longrunning.Operation] resource that can be queried with + # Operations.GetOperation + # to return + # {::Google::Cloud::DataCatalog::V1::ImportEntriesMetadata ImportEntriesMetadata} + # and an + # {::Google::Cloud::DataCatalog::V1::ImportEntriesResponse ImportEntriesResponse} + # message. + # + # @overload import_entries(request, options = nil) + # Pass arguments to `import_entries` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ImportEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ImportEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_entries(parent: nil, gcs_bucket_path: nil, job_id: nil) + # Pass arguments to `import_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Target entry group for ingested entries. + # @param gcs_bucket_path [::String] + # Path to a Cloud Storage bucket that contains a dump ready for ingestion. + # @param job_id [::String] + # Optional. (Optional) Dataplex task job id, if specified will be used as + # part of ImportEntries LRO ID + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new + # + # # Call the import_entries method. + # result = client.import_entries request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_entries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.import_entries request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the configuration related to the migration to Dataplex for an + # organization or project. + # + # @overload set_config(request, options = nil) + # Pass arguments to `set_config` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::SetConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::SetConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_config(name: nil, tag_template_migration: nil, catalog_ui_experience: nil) + # Pass arguments to `set_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The organization or project whose config is being specified. + # @param tag_template_migration [::Google::Cloud::DataCatalog::V1::TagTemplateMigration] + # Opt-in status for the migration of Tag Templates to Dataplex. + # @param catalog_ui_experience [::Google::Cloud::DataCatalog::V1::CatalogUIExperience] + # Opt-in status for the UI switch to Dataplex. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::SetConfigRequest.new + # + # # Call the set_config method. + # result = client.set_config request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::MigrationConfig. + # p result + # + def set_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::SetConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.set_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the configuration related to the migration from Data Catalog to + # Dataplex for a specific organization, including all the projects under it + # which have a separate configuration set. + # + # @overload retrieve_config(request, options = nil) + # Pass arguments to `retrieve_config` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload retrieve_config(name: nil) + # Pass arguments to `retrieve_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The organization whose config is being retrieved. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::OrganizationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::OrganizationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new + # + # # Call the retrieve_config method. + # result = client.retrieve_config request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::OrganizationConfig. + # p result + # + def retrieve_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.retrieve_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.retrieve_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.retrieve_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.retrieve_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the effective configuration related to the migration from Data + # Catalog to Dataplex for a specific organization or project. If there is no + # specific configuration set for the resource, the setting is checked + # hierarchicahlly through the ancestors of the resource, starting from the + # resource itself. + # + # @overload retrieve_effective_config(request, options = nil) + # Pass arguments to `retrieve_effective_config` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload retrieve_effective_config(name: nil) + # Pass arguments to `retrieve_effective_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource whose effective config is being retrieved. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new + # + # # Call the retrieve_effective_config method. + # result = client.retrieve_effective_config request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::MigrationConfig. + # p result + # + def retrieve_effective_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.retrieve_effective_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.retrieve_effective_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.retrieve_effective_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_catalog_stub.retrieve_effective_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DataCatalog REST API. + # + # This class represents the configuration for DataCatalog 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::DataCatalog::V1::DataCatalog::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 + # # search_catalog to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search_catalog.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search_catalog.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DataCatalog API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `search_catalog` + # @return [::Gapic::Config::Method] + # + attr_reader :search_catalog + ## + # RPC-specific configuration for `create_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entry_group + ## + # RPC-specific configuration for `get_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entry_group + ## + # RPC-specific configuration for `update_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entry_group + ## + # RPC-specific configuration for `delete_entry_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entry_group + ## + # RPC-specific configuration for `list_entry_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entry_groups + ## + # RPC-specific configuration for `create_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entry + ## + # RPC-specific configuration for `update_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entry + ## + # RPC-specific configuration for `delete_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entry + ## + # RPC-specific configuration for `get_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entry + ## + # RPC-specific configuration for `lookup_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :lookup_entry + ## + # RPC-specific configuration for `list_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entries + ## + # RPC-specific configuration for `modify_entry_overview` + # @return [::Gapic::Config::Method] + # + attr_reader :modify_entry_overview + ## + # RPC-specific configuration for `modify_entry_contacts` + # @return [::Gapic::Config::Method] + # + attr_reader :modify_entry_contacts + ## + # RPC-specific configuration for `create_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_template + ## + # RPC-specific configuration for `get_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tag_template + ## + # RPC-specific configuration for `update_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_template + ## + # RPC-specific configuration for `delete_tag_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_template + ## + # RPC-specific configuration for `create_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag_template_field + ## + # RPC-specific configuration for `update_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag_template_field + ## + # RPC-specific configuration for `rename_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :rename_tag_template_field + ## + # RPC-specific configuration for `rename_tag_template_field_enum_value` + # @return [::Gapic::Config::Method] + # + attr_reader :rename_tag_template_field_enum_value + ## + # RPC-specific configuration for `delete_tag_template_field` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag_template_field + ## + # RPC-specific configuration for `create_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tag + ## + # RPC-specific configuration for `update_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tag + ## + # RPC-specific configuration for `delete_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tag + ## + # RPC-specific configuration for `list_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tags + ## + # RPC-specific configuration for `reconcile_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :reconcile_tags + ## + # RPC-specific configuration for `star_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :star_entry + ## + # RPC-specific configuration for `unstar_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :unstar_entry + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `import_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :import_entries + ## + # RPC-specific configuration for `set_config` + # @return [::Gapic::Config::Method] + # + attr_reader :set_config + ## + # RPC-specific configuration for `retrieve_config` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_config + ## + # RPC-specific configuration for `retrieve_effective_config` + # @return [::Gapic::Config::Method] + # + attr_reader :retrieve_effective_config + + # @private + def initialize parent_rpcs = nil + search_catalog_config = parent_rpcs.search_catalog if parent_rpcs.respond_to? :search_catalog + @search_catalog = ::Gapic::Config::Method.new search_catalog_config + create_entry_group_config = parent_rpcs.create_entry_group if parent_rpcs.respond_to? :create_entry_group + @create_entry_group = ::Gapic::Config::Method.new create_entry_group_config + get_entry_group_config = parent_rpcs.get_entry_group if parent_rpcs.respond_to? :get_entry_group + @get_entry_group = ::Gapic::Config::Method.new get_entry_group_config + update_entry_group_config = parent_rpcs.update_entry_group if parent_rpcs.respond_to? :update_entry_group + @update_entry_group = ::Gapic::Config::Method.new update_entry_group_config + delete_entry_group_config = parent_rpcs.delete_entry_group if parent_rpcs.respond_to? :delete_entry_group + @delete_entry_group = ::Gapic::Config::Method.new delete_entry_group_config + list_entry_groups_config = parent_rpcs.list_entry_groups if parent_rpcs.respond_to? :list_entry_groups + @list_entry_groups = ::Gapic::Config::Method.new list_entry_groups_config + create_entry_config = parent_rpcs.create_entry if parent_rpcs.respond_to? :create_entry + @create_entry = ::Gapic::Config::Method.new create_entry_config + update_entry_config = parent_rpcs.update_entry if parent_rpcs.respond_to? :update_entry + @update_entry = ::Gapic::Config::Method.new update_entry_config + delete_entry_config = parent_rpcs.delete_entry if parent_rpcs.respond_to? :delete_entry + @delete_entry = ::Gapic::Config::Method.new delete_entry_config + get_entry_config = parent_rpcs.get_entry if parent_rpcs.respond_to? :get_entry + @get_entry = ::Gapic::Config::Method.new get_entry_config + lookup_entry_config = parent_rpcs.lookup_entry if parent_rpcs.respond_to? :lookup_entry + @lookup_entry = ::Gapic::Config::Method.new lookup_entry_config + list_entries_config = parent_rpcs.list_entries if parent_rpcs.respond_to? :list_entries + @list_entries = ::Gapic::Config::Method.new list_entries_config + modify_entry_overview_config = parent_rpcs.modify_entry_overview if parent_rpcs.respond_to? :modify_entry_overview + @modify_entry_overview = ::Gapic::Config::Method.new modify_entry_overview_config + modify_entry_contacts_config = parent_rpcs.modify_entry_contacts if parent_rpcs.respond_to? :modify_entry_contacts + @modify_entry_contacts = ::Gapic::Config::Method.new modify_entry_contacts_config + create_tag_template_config = parent_rpcs.create_tag_template if parent_rpcs.respond_to? :create_tag_template + @create_tag_template = ::Gapic::Config::Method.new create_tag_template_config + get_tag_template_config = parent_rpcs.get_tag_template if parent_rpcs.respond_to? :get_tag_template + @get_tag_template = ::Gapic::Config::Method.new get_tag_template_config + update_tag_template_config = parent_rpcs.update_tag_template if parent_rpcs.respond_to? :update_tag_template + @update_tag_template = ::Gapic::Config::Method.new update_tag_template_config + delete_tag_template_config = parent_rpcs.delete_tag_template if parent_rpcs.respond_to? :delete_tag_template + @delete_tag_template = ::Gapic::Config::Method.new delete_tag_template_config + create_tag_template_field_config = parent_rpcs.create_tag_template_field if parent_rpcs.respond_to? :create_tag_template_field + @create_tag_template_field = ::Gapic::Config::Method.new create_tag_template_field_config + update_tag_template_field_config = parent_rpcs.update_tag_template_field if parent_rpcs.respond_to? :update_tag_template_field + @update_tag_template_field = ::Gapic::Config::Method.new update_tag_template_field_config + rename_tag_template_field_config = parent_rpcs.rename_tag_template_field if parent_rpcs.respond_to? :rename_tag_template_field + @rename_tag_template_field = ::Gapic::Config::Method.new rename_tag_template_field_config + rename_tag_template_field_enum_value_config = parent_rpcs.rename_tag_template_field_enum_value if parent_rpcs.respond_to? :rename_tag_template_field_enum_value + @rename_tag_template_field_enum_value = ::Gapic::Config::Method.new rename_tag_template_field_enum_value_config + delete_tag_template_field_config = parent_rpcs.delete_tag_template_field if parent_rpcs.respond_to? :delete_tag_template_field + @delete_tag_template_field = ::Gapic::Config::Method.new delete_tag_template_field_config + create_tag_config = parent_rpcs.create_tag if parent_rpcs.respond_to? :create_tag + @create_tag = ::Gapic::Config::Method.new create_tag_config + update_tag_config = parent_rpcs.update_tag if parent_rpcs.respond_to? :update_tag + @update_tag = ::Gapic::Config::Method.new update_tag_config + delete_tag_config = parent_rpcs.delete_tag if parent_rpcs.respond_to? :delete_tag + @delete_tag = ::Gapic::Config::Method.new delete_tag_config + list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags + @list_tags = ::Gapic::Config::Method.new list_tags_config + reconcile_tags_config = parent_rpcs.reconcile_tags if parent_rpcs.respond_to? :reconcile_tags + @reconcile_tags = ::Gapic::Config::Method.new reconcile_tags_config + star_entry_config = parent_rpcs.star_entry if parent_rpcs.respond_to? :star_entry + @star_entry = ::Gapic::Config::Method.new star_entry_config + unstar_entry_config = parent_rpcs.unstar_entry if parent_rpcs.respond_to? :unstar_entry + @unstar_entry = ::Gapic::Config::Method.new unstar_entry_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + import_entries_config = parent_rpcs.import_entries if parent_rpcs.respond_to? :import_entries + @import_entries = ::Gapic::Config::Method.new import_entries_config + set_config_config = parent_rpcs.set_config if parent_rpcs.respond_to? :set_config + @set_config = ::Gapic::Config::Method.new set_config_config + retrieve_config_config = parent_rpcs.retrieve_config if parent_rpcs.respond_to? :retrieve_config + @retrieve_config = ::Gapic::Config::Method.new retrieve_config_config + retrieve_effective_config_config = parent_rpcs.retrieve_effective_config if parent_rpcs.respond_to? :retrieve_effective_config + @retrieve_effective_config = ::Gapic::Config::Method.new retrieve_effective_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/operations.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/operations.rb new file mode 100644 index 000000000000..c210f9c204f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/operations.rb @@ -0,0 +1,906 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DataCatalog Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DataCatalog Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb new file mode 100644 index 000000000000..32fcad88f227 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/data_catalog/rest/service_stub.rb @@ -0,0 +1,2442 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/datacatalog/v1/datacatalog_pb" + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + module Rest + ## + # REST service stub for the DataCatalog service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: false, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the search_catalog REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::SearchCatalogResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::SearchCatalogResponse] + # A result object deserialized from the server's reply + def search_catalog request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_catalog_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "search_catalog", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::SearchCatalogResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # A result object deserialized from the server's reply + def create_entry_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_entry_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_entry_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::EntryGroup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # A result object deserialized from the server's reply + def get_entry_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_entry_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_entry_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::EntryGroup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # A result object deserialized from the server's reply + def update_entry_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_entry_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_entry_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::EntryGroup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entry_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_entry_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_entry_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_entry_groups REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse] + # A result object deserialized from the server's reply + def list_entry_groups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_entry_groups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_entry_groups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # A result object deserialized from the server's reply + def create_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Entry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # A result object deserialized from the server's reply + def update_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Entry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # A result object deserialized from the server's reply + def get_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Entry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the lookup_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::LookupEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Entry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # A result object deserialized from the server's reply + def lookup_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_lookup_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "lookup_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Entry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_entries REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListEntriesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ListEntriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ListEntriesResponse] + # A result object deserialized from the server's reply + def list_entries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_entries_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_entries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ListEntriesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the modify_entry_overview REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::EntryOverview] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::EntryOverview] + # A result object deserialized from the server's reply + def modify_entry_overview request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_modify_entry_overview_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "modify_entry_overview", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::EntryOverview.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the modify_entry_contacts REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Contacts] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Contacts] + # A result object deserialized from the server's reply + def modify_entry_contacts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_modify_entry_contacts_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "modify_entry_contacts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Contacts.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # A result object deserialized from the server's reply + def create_tag_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_tag_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplate.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # A result object deserialized from the server's reply + def get_tag_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tag_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_tag_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplate.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # A result object deserialized from the server's reply + def update_tag_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_tag_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplate.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_tag_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_tag_template", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # A result object deserialized from the server's reply + def create_tag_template_field request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_template_field_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_tag_template_field", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # A result object deserialized from the server's reply + def update_tag_template_field request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_template_field_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_tag_template_field", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the rename_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # A result object deserialized from the server's reply + def rename_tag_template_field request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rename_tag_template_field_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "rename_tag_template_field", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the rename_tag_template_field_enum_value REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # A result object deserialized from the server's reply + def rename_tag_template_field_enum_value request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rename_tag_template_field_enum_value_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "rename_tag_template_field_enum_value", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_tag_template_field request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_template_field_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_tag_template_field", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Tag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # A result object deserialized from the server's reply + def create_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Tag.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Tag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # A result object deserialized from the server's reply + def update_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Tag.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tags REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListTagsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ListTagsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ListTagsResponse] + # A result object deserialized from the server's reply + def list_tags request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tags_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_tags", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ListTagsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the reconcile_tags REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def reconcile_tags request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reconcile_tags_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "reconcile_tags", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the star_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::StarEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::StarEntryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::StarEntryResponse] + # A result object deserialized from the server's reply + def star_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_star_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "star_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::StarEntryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the unstar_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UnstarEntryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::UnstarEntryResponse] + # A result object deserialized from the server's reply + def unstar_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_unstar_entry_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "unstar_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_entries REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ImportEntriesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_entries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_entries_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_entries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_config REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::SetConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # A result object deserialized from the server's reply + def set_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::MigrationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the retrieve_config REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::OrganizationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::OrganizationConfig] + # A result object deserialized from the server's reply + def retrieve_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_retrieve_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "retrieve_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::OrganizationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the retrieve_effective_config REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + # A result object deserialized from the server's reply + def retrieve_effective_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_retrieve_effective_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "retrieve_effective_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::MigrationConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the search_catalog REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_catalog_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/catalog:search", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest] + # 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_entry_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entryGroups", + body: "entry_group", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest] + # 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_entry_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest] + # 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_entry_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{entry_group.name}", + body: "entry_group", + matches: [ + ["entry_group.name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_entry_group REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest] + # 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_entry_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_entry_groups REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest] + # 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_entry_groups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entryGroups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateEntryRequest] + # 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_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entries", + body: "entry", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateEntryRequest] + # 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_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{entry.name}", + body: "entry", + matches: [ + ["entry.name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteEntryRequest] + # 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_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetEntryRequest] + # 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_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the lookup_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::LookupEntryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_lookup_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/entries:lookup", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_entries REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListEntriesRequest] + # 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_entries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/entries", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the modify_entry_overview REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_modify_entry_overview_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:modifyEntryOverview", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the modify_entry_contacts REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_modify_entry_contacts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:modifyEntryContacts", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest] + # 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_tag_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tagTemplates", + body: "tag_template", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest] + # 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_tag_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest] + # 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_tag_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tag_template.name}", + body: "tag_template", + matches: [ + ["tag_template.name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag_template REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest] + # 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_tag_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest] + # 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_tag_template_field_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/fields", + body: "tag_template_field", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest] + # 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_tag_template_field_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{name}", + body: "tag_template_field", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/fields/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rename_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rename_tag_template_field_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rename", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/fields/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rename_tag_template_field_enum_value REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rename_tag_template_field_enum_value_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rename", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/fields/[^/]+/enumValues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag_template_field REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest] + # 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_tag_template_field_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/fields/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTagRequest] + # 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_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tags", + body: "tag", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tags", + body: "tag", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTagRequest] + # 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_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tag.name}", + body: "tag", + matches: [ + ["tag.name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/tags/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{tag.name}", + body: "tag", + matches: [ + ["tag.name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/tags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTagRequest] + # 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_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/tags/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/tags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tags REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListTagsRequest] + # 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_tags_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/tags", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/tags", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reconcile_tags REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reconcile_tags_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/tags:reconcile", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the star_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::StarEntryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_star_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:star", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the unstar_entry REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UnstarEntryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_unstar_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:unstar", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/tagTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/entries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_entries REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ImportEntriesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_entries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/entries:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/entryGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_config REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::SetConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setConfig", + body: "*", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:setConfig", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the retrieve_config REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_retrieve_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:retrieveConfig", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the retrieve_effective_config REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_retrieve_effective_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:retrieveEffectiveConfig", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:retrieveEffectiveConfig", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager.rb new file mode 100644 index 000000000000..7165ef2c9877 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/data_catalog/v1/version" + +require "google/cloud/data_catalog/v1/policy_tag_manager/credentials" +require "google/cloud/data_catalog/v1/policy_tag_manager/paths" +require "google/cloud/data_catalog/v1/policy_tag_manager/client" +require "google/cloud/data_catalog/v1/policy_tag_manager/rest" + +module Google + module Cloud + module DataCatalog + module V1 + ## + # Policy Tag Manager API service allows you to manage your policy tags and + # taxonomies. + # + # Policy tags are used to tag BigQuery columns and apply additional access + # control policies. A taxonomy is a hierarchical grouping of policy tags that + # classify data along a common axis. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/data_catalog/v1/policy_tag_manager" + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/data_catalog/v1/policy_tag_manager/rest" + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + module PolicyTagManager + end + end + end + end +end + +helper_path = ::File.join __dir__, "policy_tag_manager", "helpers.rb" +require "google/cloud/data_catalog/v1/policy_tag_manager/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb new file mode 100644 index 000000000000..3b5e684c67bf --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/client.rb @@ -0,0 +1,1667 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/datacatalog/v1/policytagmanager_pb" +require "google/iam/v1" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManager + ## + # Client for the PolicyTagManager service. + # + # Policy Tag Manager API service allows you to manage your policy tags and + # taxonomies. + # + # Policy tags are used to tag BigQuery columns and apply additional access + # control policies. A taxonomy is a hierarchical grouping of policy tags that + # classify data along a common axis. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :policy_tag_manager_stub + + ## + # Configure the PolicyTagManager Client class. + # + # See {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyTagManager clients + # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::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", "DataCatalog", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyTagManager 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::DataCatalog::V1::PolicyTagManager::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @policy_tag_manager_stub.universe_domain + end + + ## + # Create a new PolicyTagManager client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyTagManager 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/datacatalog/v1/policytagmanager_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @policy_tag_manager_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @policy_tag_manager_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_stub.endpoint + config.universe_domain = @policy_tag_manager_stub.universe_domain + config.logger = @policy_tag_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policy_tag_manager_stub.logger + end + + # Service calls + + ## + # Creates a taxonomy in a specified project. + # + # The taxonomy is initially empty, that is, it doesn't contain policy tags. + # + # @overload create_taxonomy(request, options = nil) + # Pass arguments to `create_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_taxonomy(parent: nil, taxonomy: nil) + # Pass arguments to `create_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project that the taxonomy will belong to. + # @param taxonomy [::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash] + # The taxonomy to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new + # + # # Call the create_taxonomy method. + # result = client.create_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def create_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest + + # Converts hash and nil to 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_taxonomy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :create_taxonomy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a taxonomy, including all policy tags in this + # taxonomy, their associated policies, and the policy tags references from + # BigQuery columns. + # + # @overload delete_taxonomy(request, options = nil) + # Pass arguments to `delete_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_taxonomy(name: nil) + # Pass arguments to `delete_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the taxonomy to delete. + # + # Note: All policy tags in this taxonomy are also deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new + # + # # Call the delete_taxonomy method. + # result = client.delete_taxonomy request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest + + # Converts hash and nil to 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_taxonomy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :delete_taxonomy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a taxonomy, including its display name, + # description, and activated policy types. + # + # @overload update_taxonomy(request, options = nil) + # Pass arguments to `update_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_taxonomy(taxonomy: nil, update_mask: nil) + # Pass arguments to `update_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param taxonomy [::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash] + # The taxonomy to update. You can update only its description, display name, + # and activated policy types. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies fields to update. If not set, defaults to all fields you can + # update. + # + # For more information, see [FieldMask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new + # + # # Call the update_taxonomy method. + # result = client.update_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def update_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest + + # Converts hash and nil to 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.taxonomy&.name + header_params["taxonomy.name"] = request.taxonomy.name + end + + request_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_taxonomy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :update_taxonomy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all taxonomies in a project in a particular location that you + # have a permission to view. + # + # @overload list_taxonomies(request, options = nil) + # Pass arguments to `list_taxonomies` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_taxonomies(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_taxonomies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project to list the taxonomies of. + # @param page_size [::Integer] + # The maximum number of items to return. Must be a value between 1 and 1000 + # inclusively. If not set, defaults to 50. + # @param page_token [::String] + # The pagination token of the next results page. If not set, + # the first page is returned. + # + # The token is returned in the response to a previous list request. + # @param filter [::String] + # Supported field for filter is 'service' and value is 'dataplex'. + # Eg: service=dataplex. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new + # + # # Call the list_taxonomies method. + # result = client.list_taxonomies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy. + # p item + # end + # + def list_taxonomies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest + + # Converts hash and nil to 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_taxonomies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_taxonomies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_taxonomies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :list_taxonomies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a taxonomy. + # + # @overload get_taxonomy(request, options = nil) + # Pass arguments to `get_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_taxonomy(name: nil) + # Pass arguments to `get_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the taxonomy to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new + # + # # Call the get_taxonomy method. + # result = client.get_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def get_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest + + # Converts hash and nil to 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_taxonomy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :get_taxonomy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a policy tag in a taxonomy. + # + # @overload create_policy_tag(request, options = nil) + # Pass arguments to `create_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_policy_tag(parent: nil, policy_tag: nil) + # Pass arguments to `create_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the taxonomy that the policy tag will belong to. + # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash] + # The policy tag to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new + # + # # Call the create_policy_tag method. + # result = client.create_policy_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + # p result + # + def create_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest + + # Converts hash and nil to 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_policy_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :create_policy_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a policy tag together with the following: + # + # * All of its descendant policy tags, if any + # * Policies associated with the policy tag and its descendants + # * References from BigQuery table schema of the policy tag and its + # descendants + # + # @overload delete_policy_tag(request, options = nil) + # Pass arguments to `delete_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_policy_tag(name: nil) + # Pass arguments to `delete_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the policy tag to delete. + # + # Note: All of its descendant policy tags are also deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new + # + # # Call the delete_policy_tag method. + # result = client.delete_policy_tag request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest + + # Converts hash and nil to 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_policy_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :delete_policy_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a policy tag, including its display + # name, description, and parent policy tag. + # + # @overload update_policy_tag(request, options = nil) + # Pass arguments to `update_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy_tag(policy_tag: nil, update_mask: nil) + # Pass arguments to `update_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash] + # The policy tag to update. You can update only its description, display + # name, and parent policy tag fields. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies the fields to update. + # + # You can update only display name, description, and parent policy tag. + # If not set, defaults to all updatable fields. + # For more information, see [FieldMask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new + # + # # Call the update_policy_tag method. + # result = client.update_policy_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + # p result + # + def update_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest + + # Converts hash and nil to 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.policy_tag&.name + header_params["policy_tag.name"] = request.policy_tag.name + end + + request_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_policy_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :update_policy_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all policy tags in a taxonomy. + # + # @overload list_policy_tags(request, options = nil) + # Pass arguments to `list_policy_tags` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_policy_tags(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_policy_tags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the taxonomy to list the policy tags of. + # @param page_size [::Integer] + # The maximum number of items to return. Must be a value between 1 and 1000 + # inclusively. + # If not set, defaults to 50. + # @param page_token [::String] + # The pagination token of the next results page. If not set, returns the + # first page. + # + # The token is returned in the response to a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new + # + # # Call the list_policy_tags method. + # result = client.list_policy_tags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag. + # p item + # end + # + def list_policy_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest + + # Converts hash and nil to 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_policy_tags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_policy_tags.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_policy_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :list_policy_tags, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a policy tag. + # + # @overload get_policy_tag(request, options = nil) + # Pass arguments to `get_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_policy_tag(name: nil) + # Pass arguments to `get_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the policy tag. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new + # + # # Call the get_policy_tag method. + # result = client.get_policy_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + # p result + # + def get_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest + + # Converts hash and nil to 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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_policy_tag.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :get_policy_tag, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the IAM policy for a policy tag or a taxonomy. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM policy for a policy tag or a taxonomy. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns your permissions on a specified policy tag or + # taxonomy. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PolicyTagManager API. + # + # This class represents the configuration for PolicyTagManager, + # providing control 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::DataCatalog::V1::PolicyTagManager::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_taxonomy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_taxonomy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_taxonomy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the PolicyTagManager API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_taxonomy + ## + # RPC-specific configuration for `delete_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_taxonomy + ## + # RPC-specific configuration for `update_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_taxonomy + ## + # RPC-specific configuration for `list_taxonomies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_taxonomies + ## + # RPC-specific configuration for `get_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_taxonomy + ## + # RPC-specific configuration for `create_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy_tag + ## + # RPC-specific configuration for `delete_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy_tag + ## + # RPC-specific configuration for `update_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :update_policy_tag + ## + # RPC-specific configuration for `list_policy_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policy_tags + ## + # RPC-specific configuration for `get_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy_tag + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_taxonomy_config = parent_rpcs.create_taxonomy if parent_rpcs.respond_to? :create_taxonomy + @create_taxonomy = ::Gapic::Config::Method.new create_taxonomy_config + delete_taxonomy_config = parent_rpcs.delete_taxonomy if parent_rpcs.respond_to? :delete_taxonomy + @delete_taxonomy = ::Gapic::Config::Method.new delete_taxonomy_config + update_taxonomy_config = parent_rpcs.update_taxonomy if parent_rpcs.respond_to? :update_taxonomy + @update_taxonomy = ::Gapic::Config::Method.new update_taxonomy_config + list_taxonomies_config = parent_rpcs.list_taxonomies if parent_rpcs.respond_to? :list_taxonomies + @list_taxonomies = ::Gapic::Config::Method.new list_taxonomies_config + get_taxonomy_config = parent_rpcs.get_taxonomy if parent_rpcs.respond_to? :get_taxonomy + @get_taxonomy = ::Gapic::Config::Method.new get_taxonomy_config + create_policy_tag_config = parent_rpcs.create_policy_tag if parent_rpcs.respond_to? :create_policy_tag + @create_policy_tag = ::Gapic::Config::Method.new create_policy_tag_config + delete_policy_tag_config = parent_rpcs.delete_policy_tag if parent_rpcs.respond_to? :delete_policy_tag + @delete_policy_tag = ::Gapic::Config::Method.new delete_policy_tag_config + update_policy_tag_config = parent_rpcs.update_policy_tag if parent_rpcs.respond_to? :update_policy_tag + @update_policy_tag = ::Gapic::Config::Method.new update_policy_tag_config + list_policy_tags_config = parent_rpcs.list_policy_tags if parent_rpcs.respond_to? :list_policy_tags + @list_policy_tags = ::Gapic::Config::Method.new list_policy_tags_config + get_policy_tag_config = parent_rpcs.get_policy_tag if parent_rpcs.respond_to? :get_policy_tag + @get_policy_tag = ::Gapic::Config::Method.new get_policy_tag_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/credentials.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/credentials.rb new file mode 100644 index 000000000000..cc989bc7b5c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManager + # Credentials for the PolicyTagManager API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATA_CATALOG_CREDENTIALS", + "DATA_CATALOG_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATA_CATALOG_CREDENTIALS_JSON", + "DATA_CATALOG_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-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/paths.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/paths.rb new file mode 100644 index 000000000000..e4469a55219d --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManager + # Path helper methods for the PolicyTagManager API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified PolicyTag resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}` + # + # @param project [String] + # @param location [String] + # @param taxonomy [String] + # @param policy_tag [String] + # + # @return [::String] + def policy_tag_path project:, location:, taxonomy:, policy_tag: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "taxonomy cannot contain /" if taxonomy.to_s.include? "/" + + "projects/#{project}/locations/#{location}/taxonomies/#{taxonomy}/policyTags/#{policy_tag}" + end + + ## + # Create a fully-qualified Taxonomy resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/taxonomies/{taxonomy}` + # + # @param project [String] + # @param location [String] + # @param taxonomy [String] + # + # @return [::String] + def taxonomy_path project:, location:, taxonomy: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/taxonomies/#{taxonomy}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest.rb new file mode 100644 index 000000000000..ab4d9e3bff67 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/data_catalog/v1/version" + +require "google/cloud/data_catalog/v1/policy_tag_manager/credentials" +require "google/cloud/data_catalog/v1/policy_tag_manager/paths" +require "google/cloud/data_catalog/v1/policy_tag_manager/rest/client" + +module Google + module Cloud + module DataCatalog + module V1 + ## + # Policy Tag Manager API service allows you to manage your policy tags and + # taxonomies. + # + # Policy tags are used to tag BigQuery columns and apply additional access + # control policies. A taxonomy is a hierarchical grouping of policy tags that + # classify data along a common axis. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/data_catalog/v1/policy_tag_manager/rest" + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + module PolicyTagManager + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/data_catalog/v1/policy_tag_manager/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb new file mode 100644 index 000000000000..6662cc7e7b7f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/client.rb @@ -0,0 +1,1550 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/datacatalog/v1/policytagmanager_pb" +require "google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManager + module Rest + ## + # REST client for the PolicyTagManager service. + # + # Policy Tag Manager API service allows you to manage your policy tags and + # taxonomies. + # + # Policy tags are used to tag BigQuery columns and apply additional access + # control policies. A taxonomy is a hierarchical grouping of policy tags that + # classify data along a common axis. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :policy_tag_manager_stub + + ## + # Configure the PolicyTagManager Client class. + # + # See {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyTagManager clients + # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::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", "DataCatalog", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyTagManager 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::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @policy_tag_manager_stub.universe_domain + end + + ## + # Create a new PolicyTagManager REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyTagManager client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @policy_tag_manager_stub = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @policy_tag_manager_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_stub.endpoint + config.universe_domain = @policy_tag_manager_stub.universe_domain + config.logger = @policy_tag_manager_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policy_tag_manager_stub.logger + end + + # Service calls + + ## + # Creates a taxonomy in a specified project. + # + # The taxonomy is initially empty, that is, it doesn't contain policy tags. + # + # @overload create_taxonomy(request, options = nil) + # Pass arguments to `create_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_taxonomy(parent: nil, taxonomy: nil) + # Pass arguments to `create_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project that the taxonomy will belong to. + # @param taxonomy [::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash] + # The taxonomy to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new + # + # # Call the create_taxonomy method. + # result = client.create_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def create_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest + + # Converts hash and nil to an 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_taxonomy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.create_taxonomy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a taxonomy, including all policy tags in this + # taxonomy, their associated policies, and the policy tags references from + # BigQuery columns. + # + # @overload delete_taxonomy(request, options = nil) + # Pass arguments to `delete_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_taxonomy(name: nil) + # Pass arguments to `delete_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the taxonomy to delete. + # + # Note: All policy tags in this taxonomy are also deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new + # + # # Call the delete_taxonomy method. + # result = client.delete_taxonomy request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest + + # Converts hash and nil to an 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_taxonomy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.delete_taxonomy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a taxonomy, including its display name, + # description, and activated policy types. + # + # @overload update_taxonomy(request, options = nil) + # Pass arguments to `update_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_taxonomy(taxonomy: nil, update_mask: nil) + # Pass arguments to `update_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param taxonomy [::Google::Cloud::DataCatalog::V1::Taxonomy, ::Hash] + # The taxonomy to update. You can update only its description, display name, + # and activated policy types. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies fields to update. If not set, defaults to all fields you can + # update. + # + # For more information, see [FieldMask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new + # + # # Call the update_taxonomy method. + # result = client.update_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def update_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest + + # Converts hash and nil to an 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_taxonomy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.update_taxonomy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all taxonomies in a project in a particular location that you + # have a permission to view. + # + # @overload list_taxonomies(request, options = nil) + # Pass arguments to `list_taxonomies` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_taxonomies(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_taxonomies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project to list the taxonomies of. + # @param page_size [::Integer] + # The maximum number of items to return. Must be a value between 1 and 1000 + # inclusively. If not set, defaults to 50. + # @param page_token [::String] + # The pagination token of the next results page. If not set, + # the first page is returned. + # + # The token is returned in the response to a previous list request. + # @param filter [::String] + # Supported field for filter is 'service' and value is 'dataplex'. + # Eg: service=dataplex. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::Taxonomy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new + # + # # Call the list_taxonomies method. + # result = client.list_taxonomies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy. + # p item + # end + # + def list_taxonomies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest + + # Converts hash and nil to an 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_taxonomies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_taxonomies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_taxonomies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.list_taxonomies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_taxonomies, "taxonomies", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a taxonomy. + # + # @overload get_taxonomy(request, options = nil) + # Pass arguments to `get_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_taxonomy(name: nil) + # Pass arguments to `get_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the taxonomy to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new + # + # # Call the get_taxonomy method. + # result = client.get_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def get_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest + + # Converts hash and nil to an 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_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_taxonomy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.get_taxonomy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a policy tag in a taxonomy. + # + # @overload create_policy_tag(request, options = nil) + # Pass arguments to `create_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_policy_tag(parent: nil, policy_tag: nil) + # Pass arguments to `create_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the taxonomy that the policy tag will belong to. + # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash] + # The policy tag to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new + # + # # Call the create_policy_tag method. + # result = client.create_policy_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + # p result + # + def create_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest + + # Converts hash and nil to an 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_policy_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.create_policy_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a policy tag together with the following: + # + # * All of its descendant policy tags, if any + # * Policies associated with the policy tag and its descendants + # * References from BigQuery table schema of the policy tag and its + # descendants + # + # @overload delete_policy_tag(request, options = nil) + # Pass arguments to `delete_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_policy_tag(name: nil) + # Pass arguments to `delete_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the policy tag to delete. + # + # Note: All of its descendant policy tags are also deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new + # + # # Call the delete_policy_tag method. + # result = client.delete_policy_tag request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest + + # Converts hash and nil to an 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_policy_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.delete_policy_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a policy tag, including its display + # name, description, and parent policy tag. + # + # @overload update_policy_tag(request, options = nil) + # Pass arguments to `update_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy_tag(policy_tag: nil, update_mask: nil) + # Pass arguments to `update_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param policy_tag [::Google::Cloud::DataCatalog::V1::PolicyTag, ::Hash] + # The policy tag to update. You can update only its description, display + # name, and parent policy tag fields. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Specifies the fields to update. + # + # You can update only display name, description, and parent policy tag. + # If not set, defaults to all updatable fields. + # For more information, see [FieldMask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new + # + # # Call the update_policy_tag method. + # result = client.update_policy_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + # p result + # + def update_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest + + # Converts hash and nil to an 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_policy_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.update_policy_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all policy tags in a taxonomy. + # + # @overload list_policy_tags(request, options = nil) + # Pass arguments to `list_policy_tags` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_policy_tags(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_policy_tags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the taxonomy to list the policy tags of. + # @param page_size [::Integer] + # The maximum number of items to return. Must be a value between 1 and 1000 + # inclusively. + # If not set, defaults to 50. + # @param page_token [::String] + # The pagination token of the next results page. If not set, returns the + # first page. + # + # The token is returned in the response to a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataCatalog::V1::PolicyTag>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new + # + # # Call the list_policy_tags method. + # result = client.list_policy_tags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag. + # p item + # end + # + def list_policy_tags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest + + # Converts hash and nil to an 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_policy_tags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_policy_tags.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_policy_tags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.list_policy_tags request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @policy_tag_manager_stub, :list_policy_tags, "policy_tags", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a policy tag. + # + # @overload get_policy_tag(request, options = nil) + # Pass arguments to `get_policy_tag` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_policy_tag(name: nil) + # Pass arguments to `get_policy_tag` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the policy tag. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new + # + # # Call the get_policy_tag method. + # result = client.get_policy_tag request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + # p result + # + def get_policy_tag request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest + + # Converts hash and nil to an 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_policy_tag.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_policy_tag.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_policy_tag.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.get_policy_tag request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the IAM policy for a policy tag or a taxonomy. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM policy for a policy tag or a taxonomy. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns your permissions on a specified policy tag or + # taxonomy. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PolicyTagManager REST API. + # + # This class represents the configuration for PolicyTagManager 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::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_taxonomy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_taxonomy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_taxonomy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PolicyTagManager API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_taxonomy + ## + # RPC-specific configuration for `delete_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_taxonomy + ## + # RPC-specific configuration for `update_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_taxonomy + ## + # RPC-specific configuration for `list_taxonomies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_taxonomies + ## + # RPC-specific configuration for `get_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_taxonomy + ## + # RPC-specific configuration for `create_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy_tag + ## + # RPC-specific configuration for `delete_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy_tag + ## + # RPC-specific configuration for `update_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :update_policy_tag + ## + # RPC-specific configuration for `list_policy_tags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policy_tags + ## + # RPC-specific configuration for `get_policy_tag` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy_tag + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_taxonomy_config = parent_rpcs.create_taxonomy if parent_rpcs.respond_to? :create_taxonomy + @create_taxonomy = ::Gapic::Config::Method.new create_taxonomy_config + delete_taxonomy_config = parent_rpcs.delete_taxonomy if parent_rpcs.respond_to? :delete_taxonomy + @delete_taxonomy = ::Gapic::Config::Method.new delete_taxonomy_config + update_taxonomy_config = parent_rpcs.update_taxonomy if parent_rpcs.respond_to? :update_taxonomy + @update_taxonomy = ::Gapic::Config::Method.new update_taxonomy_config + list_taxonomies_config = parent_rpcs.list_taxonomies if parent_rpcs.respond_to? :list_taxonomies + @list_taxonomies = ::Gapic::Config::Method.new list_taxonomies_config + get_taxonomy_config = parent_rpcs.get_taxonomy if parent_rpcs.respond_to? :get_taxonomy + @get_taxonomy = ::Gapic::Config::Method.new get_taxonomy_config + create_policy_tag_config = parent_rpcs.create_policy_tag if parent_rpcs.respond_to? :create_policy_tag + @create_policy_tag = ::Gapic::Config::Method.new create_policy_tag_config + delete_policy_tag_config = parent_rpcs.delete_policy_tag if parent_rpcs.respond_to? :delete_policy_tag + @delete_policy_tag = ::Gapic::Config::Method.new delete_policy_tag_config + update_policy_tag_config = parent_rpcs.update_policy_tag if parent_rpcs.respond_to? :update_policy_tag + @update_policy_tag = ::Gapic::Config::Method.new update_policy_tag_config + list_policy_tags_config = parent_rpcs.list_policy_tags if parent_rpcs.respond_to? :list_policy_tags + @list_policy_tags = ::Gapic::Config::Method.new list_policy_tags_config + get_policy_tag_config = parent_rpcs.get_policy_tag if parent_rpcs.respond_to? :get_policy_tag + @get_policy_tag = ::Gapic::Config::Method.new get_policy_tag_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb new file mode 100644 index 000000000000..5e0d478e5764 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager/rest/service_stub.rb @@ -0,0 +1,905 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/datacatalog/v1/policytagmanager_pb" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManager + module Rest + ## + # REST service stub for the PolicyTagManager service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: false, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # A result object deserialized from the server's reply + def create_taxonomy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_taxonomy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_taxonomy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Taxonomy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_taxonomy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_taxonomy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_taxonomy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # A result object deserialized from the server's reply + def update_taxonomy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_taxonomy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_taxonomy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Taxonomy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_taxonomies REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse] + # A result object deserialized from the server's reply + def list_taxonomies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_taxonomies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_taxonomies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # A result object deserialized from the server's reply + def get_taxonomy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_taxonomy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_taxonomy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Taxonomy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # A result object deserialized from the server's reply + def create_policy_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_policy_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::PolicyTag.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_policy_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_policy_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # A result object deserialized from the server's reply + def update_policy_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_policy_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::PolicyTag.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_policy_tags REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse] + # A result object deserialized from the server's reply + def list_policy_tags request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_policy_tags_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_policy_tags", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::PolicyTag] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # A result object deserialized from the server's reply + def get_policy_tag request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_tag_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_policy_tag", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::PolicyTag.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest] + # 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_taxonomy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/taxonomies", + body: "taxonomy", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest] + # 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_taxonomy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest] + # 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_taxonomy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{taxonomy.name}", + body: "taxonomy", + matches: [ + ["taxonomy.name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_taxonomies REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest] + # 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_taxonomies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/taxonomies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest] + # 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_taxonomy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest] + # 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_policy_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/policyTags", + body: "policy_tag", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest] + # 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_policy_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/policyTags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest] + # 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_policy_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{policy_tag.name}", + body: "policy_tag", + matches: [ + ["policy_tag.name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/policyTags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_policy_tags REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest] + # 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_policy_tags_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/policyTags", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_policy_tag REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest] + # 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_policy_tag_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/policyTags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/policyTags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/policyTags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/policyTags/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization.rb new file mode 100644 index 000000000000..ff3765d82b08 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/data_catalog/v1/version" + +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/credentials" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/paths" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/client" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest" + +module Google + module Cloud + module DataCatalog + module V1 + ## + # Policy Tag Manager Serialization API service allows you to manipulate + # your policy tags and taxonomies in a serialized format. + # + # Taxonomy is a hierarchical group of policy tags. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/data_catalog/v1/policy_tag_manager_serialization" + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest" + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new + # + module PolicyTagManagerSerialization + end + end + end + end +end + +helper_path = ::File.join __dir__, "policy_tag_manager_serialization", "helpers.rb" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb new file mode 100644 index 000000000000..0c50755d3103 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/client.rb @@ -0,0 +1,692 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/datacatalog/v1/policytagmanagerserialization_pb" +require "google/iam/v1" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManagerSerialization + ## + # Client for the PolicyTagManagerSerialization service. + # + # Policy Tag Manager Serialization API service allows you to manipulate + # your policy tags and taxonomies in a serialized format. + # + # Taxonomy is a hierarchical group of policy tags. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :policy_tag_manager_serialization_stub + + ## + # Configure the PolicyTagManagerSerialization Client class. + # + # See {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyTagManagerSerialization clients + # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::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", "DataCatalog", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyTagManagerSerialization 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::DataCatalog::V1::PolicyTagManagerSerialization::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @policy_tag_manager_serialization_stub.universe_domain + end + + ## + # Create a new PolicyTagManagerSerialization client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyTagManagerSerialization 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/datacatalog/v1/policytagmanagerserialization_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @policy_tag_manager_serialization_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @policy_tag_manager_serialization_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_serialization_stub.endpoint + config.universe_domain = @policy_tag_manager_serialization_stub.universe_domain + config.logger = @policy_tag_manager_serialization_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policy_tag_manager_serialization_stub.logger + end + + # Service calls + + ## + # Replaces (updates) a taxonomy and all its policy tags. + # + # The taxonomy and its entire hierarchy of policy tags must be + # represented literally by `SerializedTaxonomy` and the nested + # `SerializedPolicyTag` messages. + # + # This operation automatically does the following: + # + # - Deletes the existing policy tags that are missing from the + # `SerializedPolicyTag`. + # - Creates policy tags that don't have resource names. They are considered + # new. + # - Updates policy tags with valid resources names accordingly. + # + # @overload replace_taxonomy(request, options = nil) + # Pass arguments to `replace_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload replace_taxonomy(name: nil, serialized_taxonomy: nil) + # Pass arguments to `replace_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the taxonomy to update. + # @param serialized_taxonomy [::Google::Cloud::DataCatalog::V1::SerializedTaxonomy, ::Hash] + # Required. Taxonomy to update along with its child policy tags. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new + # + # # Call the replace_taxonomy method. + # result = client.replace_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def replace_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.replace_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.replace_taxonomy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.replace_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_serialization_stub.call_rpc :replace_taxonomy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates new taxonomies (including their policy tags) in a given project + # by importing from inlined or cross-regional sources. + # + # For a cross-regional source, new taxonomies are created by copying + # from a source in another region. + # + # For an inlined source, taxonomies and policy tags are created in bulk using + # nested protocol buffer structures. + # + # @overload import_taxonomies(request, options = nil) + # Pass arguments to `import_taxonomies` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_taxonomies(parent: nil, inline_source: nil, cross_regional_source: nil) + # Pass arguments to `import_taxonomies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of project that the imported taxonomies will belong + # to. + # @param inline_source [::Google::Cloud::DataCatalog::V1::InlineSource, ::Hash] + # Inline source taxonomy to import. + # @param cross_regional_source [::Google::Cloud::DataCatalog::V1::CrossRegionalSource, ::Hash] + # Cross-regional source taxonomy to import. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new + # + # # Call the import_taxonomies method. + # result = client.import_taxonomies request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse. + # p result + # + def import_taxonomies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_taxonomies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_taxonomies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_serialization_stub.call_rpc :import_taxonomies, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports taxonomies in the requested type and returns them, + # including their policy tags. The requested taxonomies must belong to the + # same project. + # + # This method generates `SerializedTaxonomy` protocol buffers with nested + # policy tags that can be used as input for `ImportTaxonomies` calls. + # + # @overload export_taxonomies(request, options = nil) + # Pass arguments to `export_taxonomies` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil) + # Pass arguments to `export_taxonomies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project that the exported taxonomies belong + # to. + # @param taxonomies [::Array<::String>] + # Required. Resource names of the taxonomies to export. + # @param serialized_taxonomies [::Boolean] + # Serialized export taxonomies that contain all the policy + # tags as nested protocol buffers. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new + # + # # Call the export_taxonomies method. + # result = client.export_taxonomies request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse. + # p result + # + def export_taxonomies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_taxonomies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_taxonomies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_serialization_stub.call_rpc :export_taxonomies, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PolicyTagManagerSerialization API. + # + # This class represents the configuration for PolicyTagManagerSerialization, + # providing control 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::DataCatalog::V1::PolicyTagManagerSerialization::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # replace_taxonomy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.replace_taxonomy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.replace_taxonomy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the PolicyTagManagerSerialization API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `replace_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :replace_taxonomy + ## + # RPC-specific configuration for `import_taxonomies` + # @return [::Gapic::Config::Method] + # + attr_reader :import_taxonomies + ## + # RPC-specific configuration for `export_taxonomies` + # @return [::Gapic::Config::Method] + # + attr_reader :export_taxonomies + + # @private + def initialize parent_rpcs = nil + replace_taxonomy_config = parent_rpcs.replace_taxonomy if parent_rpcs.respond_to? :replace_taxonomy + @replace_taxonomy = ::Gapic::Config::Method.new replace_taxonomy_config + import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies + @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config + export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies + @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/credentials.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/credentials.rb new file mode 100644 index 000000000000..4fb65ba0cc52 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManagerSerialization + # Credentials for the PolicyTagManagerSerialization API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATA_CATALOG_CREDENTIALS", + "DATA_CATALOG_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATA_CATALOG_CREDENTIALS_JSON", + "DATA_CATALOG_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-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/paths.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/paths.rb new file mode 100644 index 000000000000..d1e70ac5cd85 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManagerSerialization + # Path helper methods for the PolicyTagManagerSerialization API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Taxonomy resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/taxonomies/{taxonomy}` + # + # @param project [String] + # @param location [String] + # @param taxonomy [String] + # + # @return [::String] + def taxonomy_path project:, location:, taxonomy: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/taxonomies/#{taxonomy}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest.rb new file mode 100644 index 000000000000..81f1c07faadf --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/data_catalog/v1/version" + +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/credentials" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/paths" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client" + +module Google + module Cloud + module DataCatalog + module V1 + ## + # Policy Tag Manager Serialization API service allows you to manipulate + # your policy tags and taxonomies in a serialized format. + # + # Taxonomy is a hierarchical group of policy tags. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest" + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new + # + module PolicyTagManagerSerialization + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb new file mode 100644 index 000000000000..b3aef0326d66 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/client.rb @@ -0,0 +1,645 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the 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/datacatalog/v1/policytagmanagerserialization_pb" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManagerSerialization + module Rest + ## + # REST client for the PolicyTagManagerSerialization service. + # + # Policy Tag Manager Serialization API service allows you to manipulate + # your policy tags and taxonomies in a serialized format. + # + # Taxonomy is a hierarchical group of policy tags. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "datacatalog.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :policy_tag_manager_serialization_stub + + ## + # Configure the PolicyTagManagerSerialization Client class. + # + # See {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyTagManagerSerialization clients + # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::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", "DataCatalog", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyTagManagerSerialization 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::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @policy_tag_manager_serialization_stub.universe_domain + end + + ## + # Create a new PolicyTagManagerSerialization REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyTagManagerSerialization client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @policy_tag_manager_serialization_stub = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @policy_tag_manager_serialization_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @policy_tag_manager_serialization_stub.endpoint + config.universe_domain = @policy_tag_manager_serialization_stub.universe_domain + config.logger = @policy_tag_manager_serialization_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policy_tag_manager_serialization_stub.logger + end + + # Service calls + + ## + # Replaces (updates) a taxonomy and all its policy tags. + # + # The taxonomy and its entire hierarchy of policy tags must be + # represented literally by `SerializedTaxonomy` and the nested + # `SerializedPolicyTag` messages. + # + # This operation automatically does the following: + # + # - Deletes the existing policy tags that are missing from the + # `SerializedPolicyTag`. + # - Creates policy tags that don't have resource names. They are considered + # new. + # - Updates policy tags with valid resources names accordingly. + # + # @overload replace_taxonomy(request, options = nil) + # Pass arguments to `replace_taxonomy` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload replace_taxonomy(name: nil, serialized_taxonomy: nil) + # Pass arguments to `replace_taxonomy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the taxonomy to update. + # @param serialized_taxonomy [::Google::Cloud::DataCatalog::V1::SerializedTaxonomy, ::Hash] + # Required. Taxonomy to update along with its child policy tags. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new + # + # # Call the replace_taxonomy method. + # result = client.replace_taxonomy request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + # p result + # + def replace_taxonomy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.replace_taxonomy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.replace_taxonomy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.replace_taxonomy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_serialization_stub.replace_taxonomy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates new taxonomies (including their policy tags) in a given project + # by importing from inlined or cross-regional sources. + # + # For a cross-regional source, new taxonomies are created by copying + # from a source in another region. + # + # For an inlined source, taxonomies and policy tags are created in bulk using + # nested protocol buffer structures. + # + # @overload import_taxonomies(request, options = nil) + # Pass arguments to `import_taxonomies` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_taxonomies(parent: nil, inline_source: nil, cross_regional_source: nil) + # Pass arguments to `import_taxonomies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of project that the imported taxonomies will belong + # to. + # @param inline_source [::Google::Cloud::DataCatalog::V1::InlineSource, ::Hash] + # Inline source taxonomy to import. + # @param cross_regional_source [::Google::Cloud::DataCatalog::V1::CrossRegionalSource, ::Hash] + # Cross-regional source taxonomy to import. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new + # + # # Call the import_taxonomies method. + # result = client.import_taxonomies request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse. + # p result + # + def import_taxonomies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_taxonomies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_taxonomies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_taxonomies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_serialization_stub.import_taxonomies request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports taxonomies in the requested type and returns them, + # including their policy tags. The requested taxonomies must belong to the + # same project. + # + # This method generates `SerializedTaxonomy` protocol buffers with nested + # policy tags that can be used as input for `ImportTaxonomies` calls. + # + # @overload export_taxonomies(request, options = nil) + # Pass arguments to `export_taxonomies` via a request object, either of type + # {::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_taxonomies(parent: nil, taxonomies: nil, serialized_taxonomies: nil) + # Pass arguments to `export_taxonomies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the project that the exported taxonomies belong + # to. + # @param taxonomies [::Array<::String>] + # Required. Resource names of the taxonomies to export. + # @param serialized_taxonomies [::Boolean] + # Serialized export taxonomies that contain all the policy + # tags as nested protocol buffers. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_catalog/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new + # + # # Call the export_taxonomies method. + # result = client.export_taxonomies request + # + # # The returned object is of type Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse. + # p result + # + def export_taxonomies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_taxonomies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DataCatalog::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_taxonomies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_taxonomies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_tag_manager_serialization_stub.export_taxonomies request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PolicyTagManagerSerialization REST API. + # + # This class represents the configuration for PolicyTagManagerSerialization 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::DataCatalog::V1::PolicyTagManagerSerialization::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 + # # replace_taxonomy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.replace_taxonomy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.replace_taxonomy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "datacatalog.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PolicyTagManagerSerialization API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of 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 `replace_taxonomy` + # @return [::Gapic::Config::Method] + # + attr_reader :replace_taxonomy + ## + # RPC-specific configuration for `import_taxonomies` + # @return [::Gapic::Config::Method] + # + attr_reader :import_taxonomies + ## + # RPC-specific configuration for `export_taxonomies` + # @return [::Gapic::Config::Method] + # + attr_reader :export_taxonomies + + # @private + def initialize parent_rpcs = nil + replace_taxonomy_config = parent_rpcs.replace_taxonomy if parent_rpcs.respond_to? :replace_taxonomy + @replace_taxonomy = ::Gapic::Config::Method.new replace_taxonomy_config + import_taxonomies_config = parent_rpcs.import_taxonomies if parent_rpcs.respond_to? :import_taxonomies + @import_taxonomies = ::Gapic::Config::Method.new import_taxonomies_config + export_taxonomies_config = parent_rpcs.export_taxonomies if parent_rpcs.respond_to? :export_taxonomies + @export_taxonomies = ::Gapic::Config::Method.new export_taxonomies_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb new file mode 100644 index 000000000000..01f1f10236c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest/service_stub.rb @@ -0,0 +1,266 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/datacatalog/v1/policytagmanagerserialization_pb" + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManagerSerialization + module Rest + ## + # REST service stub for the PolicyTagManagerSerialization service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: false, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the replace_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::Taxonomy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # A result object deserialized from the server's reply + def replace_taxonomy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_replace_taxonomy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "replace_taxonomy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::Taxonomy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_taxonomies REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse] + # A result object deserialized from the server's reply + def import_taxonomies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_taxonomies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_taxonomies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_taxonomies REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse] + # A result object deserialized from the server's reply + def export_taxonomies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_taxonomies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_taxonomies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the replace_taxonomy REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_replace_taxonomy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:replace", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/taxonomies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_taxonomies REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_taxonomies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/taxonomies:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_taxonomies REST call + # + # @param request_pb [::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_taxonomies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/taxonomies:export", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/rest.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/rest.rb new file mode 100644 index 000000000000..2d5367396f75 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/data_catalog/v1/data_catalog/rest" +require "google/cloud/data_catalog/v1/policy_tag_manager/rest" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest" +require "google/cloud/data_catalog/v1/version" + +module Google + module Cloud + module DataCatalog + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/data_catalog/v1/rest" + # client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb new file mode 100644 index 000000000000..976b56ddc29c --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb new file mode 100644 index 000000000000..612ed1caf0d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/bigquery.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n*google/cloud/datacatalog/v1/bigquery.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\"\xb4\x02\n\x16\x42igQueryConnectionSpec\x12[\n\x0f\x63onnection_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.datacatalog.v1.BigQueryConnectionSpec.ConnectionType\x12P\n\tcloud_sql\x18\x02 \x01(\x0b\x32;.google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpecH\x00\x12\x16\n\x0ehas_credential\x18\x03 \x01(\x08\"@\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tCLOUD_SQL\x10\x01\x42\x11\n\x0f\x63onnection_spec\"\xe7\x01\n\x1e\x43loudSqlBigQueryConnectionSpec\x12\x13\n\x0binstance_id\x18\x01 \x01(\t\x12\x10\n\x08\x64\x61tabase\x18\x02 \x01(\t\x12V\n\x04type\x18\x03 \x01(\x0e\x32H.google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec.DatabaseType\"F\n\x0c\x44\x61tabaseType\x12\x1d\n\x19\x44\x41TABASE_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08POSTGRES\x10\x01\x12\t\n\x05MYSQL\x10\x02\"1\n\x13\x42igQueryRoutineSpec\x12\x1a\n\x12imported_libraries\x18\x01 \x03(\tB\xd2\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\rBigQueryProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + 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 DataCatalog + module V1 + BigQueryConnectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.BigQueryConnectionSpec").msgclass + BigQueryConnectionSpec::ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.BigQueryConnectionSpec.ConnectionType").enummodule + CloudSqlBigQueryConnectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec").msgclass + CloudSqlBigQueryConnectionSpec::DatabaseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec.DatabaseType").enummodule + BigQueryRoutineSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.BigQueryRoutineSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/common_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/common_pb.rb new file mode 100644 index 000000000000..ed05ad2ea809 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/common_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/common.proto + +require 'google/protobuf' + +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/datacatalog/v1/common.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"Q\n\x0fPersonalDetails\x12\x0f\n\x07starred\x18\x01 \x01(\x08\x12-\n\tstar_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp*\xcc\x01\n\x10IntegratedSystem\x12!\n\x1dINTEGRATED_SYSTEM_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x42IGQUERY\x10\x01\x12\x10\n\x0c\x43LOUD_PUBSUB\x10\x02\x12\x16\n\x12\x44\x41TAPROC_METASTORE\x10\x03\x12\x0c\n\x08\x44\x41TAPLEX\x10\x04\x12\x11\n\rCLOUD_SPANNER\x10\x06\x12\x12\n\x0e\x43LOUD_BIGTABLE\x10\x07\x12\r\n\tCLOUD_SQL\x10\x08\x12\n\n\x06LOOKER\x10\t\x12\r\n\tVERTEX_AI\x10\n*j\n\x0eManagingSystem\x12\x1f\n\x1bMANAGING_SYSTEM_UNSPECIFIED\x10\x00\x12\x1c\n\x18MANAGING_SYSTEM_DATAPLEX\x10\x01\x12\x19\n\x15MANAGING_SYSTEM_OTHER\x10\x02\x42\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DataCatalog + module V1 + PersonalDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PersonalDetails").msgclass + IntegratedSystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.IntegratedSystem").enummodule + ManagingSystem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ManagingSystem").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/data_source_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/data_source_pb.rb new file mode 100644 index 000000000000..e50a1071556c --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/data_source_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/data_source.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n-google/cloud/datacatalog/v1/data_source.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x9c\x02\n\nDataSource\x12@\n\x07service\x18\x01 \x01(\x0e\x32/.google.cloud.datacatalog.v1.DataSource.Service\x12\x10\n\x08resource\x18\x02 \x01(\t\x12\x19\n\x0csource_entry\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12L\n\x12storage_properties\x18\x04 \x01(\x0b\x32..google.cloud.datacatalog.v1.StoragePropertiesH\x00\"C\n\x07Service\x12\x17\n\x13SERVICE_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_STORAGE\x10\x01\x12\x0c\n\x08\x42IGQUERY\x10\x02\x42\x0c\n\nproperties\"<\n\x11StorageProperties\x12\x14\n\x0c\x66ile_pattern\x18\x01 \x03(\t\x12\x11\n\tfile_type\x18\x02 \x01(\tB\xd4\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\x0f\x44\x61taSourceProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + 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 DataCatalog + module V1 + DataSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataSource").msgclass + DataSource::Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataSource.Service").enummodule + StorageProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.StorageProperties").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb new file mode 100644 index 000000000000..da19804a64ed --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/datacatalog_pb.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/datacatalog.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/datacatalog/v1/bigquery_pb' +require 'google/cloud/datacatalog/v1/common_pb' +require 'google/cloud/datacatalog/v1/data_source_pb' +require 'google/cloud/datacatalog/v1/dataplex_spec_pb' +require 'google/cloud/datacatalog/v1/gcs_fileset_spec_pb' +require 'google/cloud/datacatalog/v1/schema_pb' +require 'google/cloud/datacatalog/v1/search_pb' +require 'google/cloud/datacatalog/v1/table_spec_pb' +require 'google/cloud/datacatalog/v1/tags_pb' +require 'google/cloud/datacatalog/v1/timestamps_pb' +require 'google/cloud/datacatalog/v1/usage_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n-google/cloud/datacatalog/v1/datacatalog.proto\x12\x1bgoogle.cloud.datacatalog.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/datacatalog/v1/bigquery.proto\x1a(google/cloud/datacatalog/v1/common.proto\x1a-google/cloud/datacatalog/v1/data_source.proto\x1a/google/cloud/datacatalog/v1/dataplex_spec.proto\x1a\x32google/cloud/datacatalog/v1/gcs_fileset_spec.proto\x1a(google/cloud/datacatalog/v1/schema.proto\x1a(google/cloud/datacatalog/v1/search.proto\x1a,google/cloud/datacatalog/v1/table_spec.proto\x1a&google/cloud/datacatalog/v1/tags.proto\x1a,google/cloud/datacatalog/v1/timestamps.proto\x1a\'google/cloud/datacatalog/v1/usage.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"\xa0\x03\n\x14SearchCatalogRequest\x12K\n\x05scope\x18\x06 \x01(\x0b\x32\x37.google.cloud.datacatalog.v1.SearchCatalogRequest.ScopeB\x03\xe0\x41\x02\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12\x19\n\x0c\x61\x64min_search\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xcd\x01\n\x05Scope\x12\x17\n\x0finclude_org_ids\x18\x02 \x03(\t\x12\x1b\n\x13include_project_ids\x18\x03 \x03(\t\x12#\n\x1binclude_gcp_public_datasets\x18\x07 \x01(\x08\x12!\n\x14restricted_locations\x18\x10 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cstarred_only\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1cinclude_public_tag_templates\x18\x13 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\"\x9c\x01\n\x15SearchCatalogResponse\x12\x41\n\x07results\x18\x01 \x03(\x0b\x32\x30.google.cloud.datacatalog.v1.SearchCatalogResult\x12\x12\n\ntotal_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x13\n\x0bunreachable\x18\x06 \x03(\t\"\xb3\x01\n\x17\x43reateEntryGroupRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%datacatalog.googleapis.com/EntryGroup\x12\x1b\n\x0e\x65ntry_group_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12<\n\x0b\x65ntry_group\x18\x02 \x01(\x0b\x32\'.google.cloud.datacatalog.v1.EntryGroup\"\x8d\x01\n\x17UpdateEntryGroupRequest\x12\x41\n\x0b\x65ntry_group\x18\x01 \x01(\x0b\x32\'.google.cloud.datacatalog.v1.EntryGroupB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x82\x01\n\x14GetEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"j\n\x17\x44\x65leteEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x01\n\x16ListEntryGroupsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%datacatalog.googleapis.com/EntryGroup\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"q\n\x17ListEntryGroupsResponse\x12=\n\x0c\x65ntry_groups\x18\x01 \x03(\x0b\x32\'.google.cloud.datacatalog.v1.EntryGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa2\x01\n\x12\x43reateEntryRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x15\n\x08\x65ntry_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x05\x65ntry\x18\x02 \x01(\x0b\x32\".google.cloud.datacatalog.v1.EntryB\x03\xe0\x41\x02\"}\n\x12UpdateEntryRequest\x12\x36\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\".google.cloud.datacatalog.v1.EntryB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"L\n\x12\x44\x65leteEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\"I\n\x0fGetEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\"\x99\x01\n\x12LookupEntryRequest\x12\x19\n\x0flinked_resource\x18\x01 \x01(\tH\x00\x12\x16\n\x0csql_resource\x18\x03 \x01(\tH\x00\x12\x1e\n\x14\x66ully_qualified_name\x18\x05 \x01(\tH\x00\x12\x0f\n\x07project\x18\x06 \x01(\t\x12\x10\n\x08location\x18\x07 \x01(\tB\r\n\x0btarget_name\"\x81\x11\n\x05\x45ntry\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x03\xe0\x41\x08\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x17\n\x0flinked_resource\x18\t \x01(\t\x12\x1c\n\x14\x66ully_qualified_name\x18\x1d \x01(\t\x12\x36\n\x04type\x18\x02 \x01(\x0e\x32&.google.cloud.datacatalog.v1.EntryTypeH\x00\x12\x1d\n\x13user_specified_type\x18\x10 \x01(\tH\x00\x12O\n\x11integrated_system\x18\x11 \x01(\x0e\x32-.google.cloud.datacatalog.v1.IntegratedSystemB\x03\xe0\x41\x03H\x01\x12\x1f\n\x15user_specified_system\x18\x12 \x01(\tH\x01\x12V\n\x18sql_database_system_spec\x18\' \x01(\x0b\x32\x32.google.cloud.datacatalog.v1.SqlDatabaseSystemSpecH\x02\x12K\n\x12looker_system_spec\x18( \x01(\x0b\x32-.google.cloud.datacatalog.v1.LookerSystemSpecH\x02\x12Z\n\x1a\x63loud_bigtable_system_spec\x18) \x01(\x0b\x32\x34.google.cloud.datacatalog.v1.CloudBigtableSystemSpecH\x02\x12G\n\x10gcs_fileset_spec\x18\x06 \x01(\x0b\x32+.google.cloud.datacatalog.v1.GcsFilesetSpecH\x03\x12R\n\x13\x62igquery_table_spec\x18\x0c \x01(\x0b\x32..google.cloud.datacatalog.v1.BigQueryTableSpecB\x03\xe0\x41\x03H\x03\x12_\n\x1a\x62igquery_date_sharded_spec\x18\x0f \x01(\x0b\x32\x34.google.cloud.datacatalog.v1.BigQueryDateShardedSpecB\x03\xe0\x41\x03H\x03\x12M\n\x13\x64\x61tabase_table_spec\x18\x18 \x01(\x0b\x32..google.cloud.datacatalog.v1.DatabaseTableSpecH\x04\x12\\\n\x1b\x64\x61ta_source_connection_spec\x18\x1b \x01(\x0b\x32\x35.google.cloud.datacatalog.v1.DataSourceConnectionSpecH\x04\x12@\n\x0croutine_spec\x18\x1c \x01(\x0b\x32(.google.cloud.datacatalog.v1.RoutineSpecH\x04\x12@\n\x0c\x64\x61taset_spec\x18 \x01(\x0b\x32(.google.cloud.datacatalog.v1.DatasetSpecH\x04\x12@\n\x0c\x66ileset_spec\x18! \x01(\x0b\x32(.google.cloud.datacatalog.v1.FilesetSpecH\x04\x12@\n\x0cservice_spec\x18* \x01(\x0b\x32(.google.cloud.datacatalog.v1.ServiceSpecH\x04\x12<\n\nmodel_spec\x18+ \x01(\x0b\x32&.google.cloud.datacatalog.v1.ModelSpecH\x04\x12X\n\x19\x66\x65\x61ture_online_store_spec\x18- \x01(\x0b\x32\x33.google.cloud.datacatalog.v1.FeatureOnlineStoreSpecH\x04\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x46\n\x10\x62usiness_context\x18% \x01(\x0b\x32,.google.cloud.datacatalog.v1.BusinessContext\x12\x33\n\x06schema\x18\x05 \x01(\x0b\x32#.google.cloud.datacatalog.v1.Schema\x12O\n\x18source_system_timestamps\x18\x07 \x01(\x0b\x32-.google.cloud.datacatalog.v1.SystemTimestamps\x12>\n\x0cusage_signal\x18\r \x01(\x0b\x32(.google.cloud.datacatalog.v1.UsageSignal\x12>\n\x06labels\x18\x0e \x03(\x0b\x32..google.cloud.datacatalog.v1.Entry.LabelsEntry\x12\x41\n\x0b\x64\x61ta_source\x18\x14 \x01(\x0b\x32\'.google.cloud.datacatalog.v1.DataSourceB\x03\xe0\x41\x03\x12K\n\x10personal_details\x18\x1a \x01(\x0b\x32,.google.cloud.datacatalog.v1.PersonalDetailsB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:x\xea\x41u\n datacatalog.googleapis.com/Entry\x12Qprojects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}B\x0c\n\nentry_typeB\x08\n\x06systemB\r\n\x0bsystem_specB\x0b\n\ttype_specB\x06\n\x04spec\"\xcb\x04\n\x11\x44\x61tabaseTableSpec\x12\x46\n\x04type\x18\x01 \x01(\x0e\x32\x38.google.cloud.datacatalog.v1.DatabaseTableSpec.TableType\x12K\n\x0e\x64\x61taplex_table\x18\x02 \x01(\x0b\x32..google.cloud.datacatalog.v1.DataplexTableSpecB\x03\xe0\x41\x03\x12[\n\x12\x64\x61tabase_view_spec\x18\x03 \x01(\x0b\x32?.google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec\x1a\x80\x02\n\x10\x44\x61tabaseViewSpec\x12[\n\tview_type\x18\x01 \x01(\x0e\x32H.google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType\x12\x14\n\nbase_table\x18\x02 \x01(\tH\x00\x12\x13\n\tsql_query\x18\x03 \x01(\tH\x00\"O\n\x08ViewType\x12\x19\n\x15VIEW_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rSTANDARD_VIEW\x10\x01\x12\x15\n\x11MATERIALIZED_VIEW\x10\x02\x42\x13\n\x11source_definition\"A\n\tTableType\x12\x1a\n\x16TABLE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06NATIVE\x10\x01\x12\x0c\n\x08\x45XTERNAL\x10\x02\"Y\n\x0b\x46ilesetSpec\x12J\n\x10\x64\x61taplex_fileset\x18\x01 \x01(\x0b\x32\x30.google.cloud.datacatalog.v1.DataplexFilesetSpec\"q\n\x18\x44\x61taSourceConnectionSpec\x12U\n\x18\x62igquery_connection_spec\x18\x01 \x01(\x0b\x32\x33.google.cloud.datacatalog.v1.BigQueryConnectionSpec\"\xc3\x04\n\x0bRoutineSpec\x12J\n\x0croutine_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.datacatalog.v1.RoutineSpec.RoutineType\x12\x10\n\x08language\x18\x02 \x01(\t\x12L\n\x11routine_arguments\x18\x03 \x03(\x0b\x32\x31.google.cloud.datacatalog.v1.RoutineSpec.Argument\x12\x13\n\x0breturn_type\x18\x04 \x01(\t\x12\x17\n\x0f\x64\x65\x66inition_body\x18\x05 \x01(\t\x12Q\n\x15\x62igquery_routine_spec\x18\x06 \x01(\x0b\x32\x30.google.cloud.datacatalog.v1.BigQueryRoutineSpecH\x00\x1a\xa6\x01\n\x08\x41rgument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x44\n\x04mode\x18\x02 \x01(\x0e\x32\x36.google.cloud.datacatalog.v1.RoutineSpec.Argument.Mode\x12\x0c\n\x04type\x18\x03 \x01(\t\"8\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x06\n\x02IN\x10\x01\x12\x07\n\x03OUT\x10\x02\x12\t\n\x05INOUT\x10\x03\"O\n\x0bRoutineType\x12\x1c\n\x18ROUTINE_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSCALAR_FUNCTION\x10\x01\x12\r\n\tPROCEDURE\x10\x02\x42\r\n\x0bsystem_spec\"k\n\x0b\x44\x61tasetSpec\x12M\n\x13vertex_dataset_spec\x18\x02 \x01(\x0b\x32..google.cloud.datacatalog.v1.VertexDatasetSpecH\x00\x42\r\n\x0bsystem_spec\"\\\n\x15SqlDatabaseSystemSpec\x12\x12\n\nsql_engine\x18\x01 \x01(\t\x12\x18\n\x10\x64\x61tabase_version\x18\x02 \x01(\t\x12\x15\n\rinstance_host\x18\x03 \x01(\t\"\xca\x01\n\x10LookerSystemSpec\x12\x1a\n\x12parent_instance_id\x18\x01 \x01(\t\x12$\n\x1cparent_instance_display_name\x18\x02 \x01(\t\x12\x17\n\x0fparent_model_id\x18\x03 \x01(\t\x12!\n\x19parent_model_display_name\x18\x04 \x01(\t\x12\x16\n\x0eparent_view_id\x18\x05 \x01(\t\x12 \n\x18parent_view_display_name\x18\x06 \x01(\t\"8\n\x17\x43loudBigtableSystemSpec\x12\x1d\n\x15instance_display_name\x18\x01 \x01(\t\"\xfd\x01\n\x19\x43loudBigtableInstanceSpec\x12u\n\x1c\x63loud_bigtable_cluster_specs\x18\x01 \x03(\x0b\x32O.google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec\x1ai\n\x18\x43loudBigtableClusterSpec\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x10\n\x08location\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x17\n\x0flinked_resource\x18\x04 \x01(\t\"|\n\x0bServiceSpec\x12^\n\x1c\x63loud_bigtable_instance_spec\x18\x01 \x01(\x0b\x32\x36.google.cloud.datacatalog.v1.CloudBigtableInstanceSpecH\x00\x42\r\n\x0bsystem_spec\"\xa0\x02\n\x15VertexModelSourceInfo\x12W\n\x0bsource_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.datacatalog.v1.VertexModelSourceInfo.ModelSourceType\x12\x0c\n\x04\x63opy\x18\x02 \x01(\x08\"\x9f\x01\n\x0fModelSourceType\x12!\n\x1dMODEL_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41UTOML\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\x12\x08\n\x04\x42QML\x10\x03\x12\x10\n\x0cMODEL_GARDEN\x10\x04\x12\t\n\x05GENIE\x10\x05\x12\x19\n\x15\x43USTOM_TEXT_EMBEDDING\x10\x06\x12\x0f\n\x0bMARKETPLACE\x10\x07\"\xce\x01\n\x0fVertexModelSpec\x12\x12\n\nversion_id\x18\x01 \x01(\t\x12\x17\n\x0fversion_aliases\x18\x02 \x03(\t\x12\x1b\n\x13version_description\x18\x03 \x01(\t\x12T\n\x18vertex_model_source_info\x18\x04 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1.VertexModelSourceInfo\x12\x1b\n\x13\x63ontainer_image_uri\x18\x05 \x01(\t\"\xe4\x02\n\x11VertexDatasetSpec\x12\x17\n\x0f\x64\x61ta_item_count\x18\x01 \x01(\x03\x12J\n\tdata_type\x18\x02 \x01(\x0e\x32\x37.google.cloud.datacatalog.v1.VertexDatasetSpec.DataType\"\xe9\x01\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TABLE\x10\x01\x12\t\n\x05IMAGE\x10\x02\x12\x08\n\x04TEXT\x10\x03\x12\t\n\x05VIDEO\x10\x04\x12\x10\n\x0c\x43ONVERSATION\x10\x05\x12\x0f\n\x0bTIME_SERIES\x10\x06\x12\x0c\n\x08\x44OCUMENT\x10\x07\x12\x12\n\x0eTEXT_TO_SPEECH\x10\x08\x12\x0f\n\x0bTRANSLATION\x10\t\x12\x10\n\x0cSTORE_VISION\x10\n\x12\x1e\n\x1a\x45NTERPRISE_KNOWLEDGE_GRAPH\x10\x0b\x12\x0f\n\x0bTEXT_PROMPT\x10\x0c\"e\n\tModelSpec\x12I\n\x11vertex_model_spec\x18\x01 \x01(\x0b\x32,.google.cloud.datacatalog.v1.VertexModelSpecH\x00\x42\r\n\x0bsystem_spec\"\xbe\x01\n\x16\x46\x65\x61tureOnlineStoreSpec\x12Z\n\x0cstorage_type\x18\x01 \x01(\x0e\x32?.google.cloud.datacatalog.v1.FeatureOnlineStoreSpec.StorageTypeB\x03\xe0\x41\x03\"H\n\x0bStorageType\x12\x1c\n\x18STORAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x42IGTABLE\x10\x01\x12\r\n\tOPTIMIZED\x10\x02\"\x8e\x01\n\x0f\x42usinessContext\x12\x42\n\x0e\x65ntry_overview\x18\x01 \x01(\x0b\x32*.google.cloud.datacatalog.v1.EntryOverview\x12\x37\n\x08\x63ontacts\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1.Contacts\"!\n\rEntryOverview\x12\x10\n\x08overview\x18\x01 \x01(\t\"v\n\x08\x43ontacts\x12<\n\x06people\x18\x01 \x03(\x0b\x32,.google.cloud.datacatalog.v1.Contacts.Person\x1a,\n\x06Person\x12\x13\n\x0b\x64\x65signation\x18\x01 \x01(\t\x12\r\n\x05\x65mail\x18\x02 \x01(\t\"\xb4\x02\n\nEntryGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12S\n\x17\x64\x61ta_catalog_timestamps\x18\x04 \x01(\x0b\x32-.google.cloud.datacatalog.v1.SystemTimestampsB\x03\xe0\x41\x03\x12$\n\x17transferred_to_dataplex\x18\t \x01(\x08\x42\x03\xe0\x41\x01:m\xea\x41j\n%datacatalog.googleapis.com/EntryGroup\x12\x41projects/{project}/locations/{location}/entryGroups/{entry_group}\"\xbd\x01\n\x18\x43reateTagTemplateRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&datacatalog.googleapis.com/TagTemplate\x12\x1c\n\x0ftag_template_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0ctag_template\x18\x02 \x01(\x0b\x32(.google.cloud.datacatalog.v1.TagTemplateB\x03\xe0\x41\x02\"U\n\x15GetTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\"\x90\x01\n\x18UpdateTagTemplateRequest\x12\x43\n\x0ctag_template\x18\x01 \x01(\x0b\x32(.google.cloud.datacatalog.v1.TagTemplateB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"l\n\x18\x44\x65leteTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\"~\n\x10\x43reateTagRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x32\n\x03tag\x18\x02 \x01(\x0b\x32 .google.cloud.datacatalog.v1.TagB\x03\xe0\x41\x02\"w\n\x10UpdateTagRequest\x12\x32\n\x03tag\x18\x01 \x01(\x0b\x32 .google.cloud.datacatalog.v1.TagB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"H\n\x10\x44\x65leteTagRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag\"\xd3\x01\n\x1d\x43reateTagTemplateFieldRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12\"\n\x15tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x12tag_template_field\x18\x03 \x01(\x0b\x32-.google.cloud.datacatalog.v1.TagTemplateFieldB\x03\xe0\x41\x02\"\xe8\x01\n\x1dUpdateTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12N\n\x12tag_template_field\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1.TagTemplateFieldB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x8a\x01\n\x1dRenameTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12&\n\x19new_tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x9e\x01\n&RenameTagTemplateFieldEnumValueRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4datacatalog.googleapis.com/TagTemplateFieldEnumValue\x12(\n\x1bnew_enum_value_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\"v\n\x1d\x44\x65leteTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\"p\n\x0fListTagsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"[\n\x10ListTagsResponse\x12.\n\x04tags\x18\x01 \x03(\x0b\x32 .google.cloud.datacatalog.v1.Tag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xe4\x01\n\x14ReconcileTagsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\x12\x44\n\x0ctag_template\x18\x02 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12\x1c\n\x14\x66orce_delete_missing\x18\x03 \x01(\x08\x12.\n\x04tags\x18\x04 \x03(\x0b\x32 .google.cloud.datacatalog.v1.Tag\"k\n\x15ReconcileTagsResponse\x12\x1a\n\x12\x63reated_tags_count\x18\x01 \x01(\x03\x12\x1a\n\x12updated_tags_count\x18\x02 \x01(\x03\x12\x1a\n\x12\x64\x65leted_tags_count\x18\x03 \x01(\x03\"\x93\x03\n\x15ReconcileTagsMetadata\x12U\n\x05state\x18\x01 \x01(\x0e\x32\x46.google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState\x12N\n\x06\x65rrors\x18\x02 \x03(\x0b\x32>.google.cloud.datacatalog.v1.ReconcileTagsMetadata.ErrorsEntry\x1a\x41\n\x0b\x45rrorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status:\x02\x38\x01\"\x8f\x01\n\x13ReconciliationState\x12$\n RECONCILIATION_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15RECONCILIATION_QUEUED\x10\x01\x12\x1e\n\x1aRECONCILIATION_IN_PROGRESS\x10\x02\x12\x17\n\x13RECONCILIATION_DONE\x10\x03\"\xa9\x01\n\x12ListEntriesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12-\n\tread_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"c\n\x13ListEntriesResponse\x12\x33\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\".google.cloud.datacatalog.v1.Entry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"J\n\x10StarEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\"\x13\n\x11StarEntryResponse\"L\n\x12UnstarEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\"\x15\n\x13UnstarEntryResponse\"\x8a\x01\n\x14ImportEntriesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 datacatalog.googleapis.com/Entry\x12\x19\n\x0fgcs_bucket_path\x18\x02 \x01(\tH\x00\x12\x13\n\x06job_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06source\"\x95\x01\n\x15ImportEntriesResponse\x12#\n\x16upserted_entries_count\x18\x05 \x01(\x03H\x00\x88\x01\x01\x12\"\n\x15\x64\x65leted_entries_count\x18\x06 \x01(\x03H\x01\x88\x01\x01\x42\x19\n\x17_upserted_entries_countB\x18\n\x16_deleted_entries_count\"\x88\x02\n\x15ImportEntriesMetadata\x12M\n\x05state\x18\x01 \x01(\x0e\x32>.google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState\x12\"\n\x06\x65rrors\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"|\n\x0bImportState\x12\x1c\n\x18IMPORT_STATE_UNSPECIFIED\x10\x00\x12\x11\n\rIMPORT_QUEUED\x10\x01\x12\x16\n\x12IMPORT_IN_PROGRESS\x10\x02\x12\x0f\n\x0bIMPORT_DONE\x10\x03\x12\x13\n\x0fIMPORT_OBSOLETE\x10\x04\"\x9d\x01\n\x1aModifyEntryOverviewRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\x12G\n\x0e\x65ntry_overview\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1.EntryOverviewB\x03\xe0\x41\x02\"\x92\x01\n\x1aModifyEntryContactsRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n datacatalog.googleapis.com/Entry\x12<\n\x08\x63ontacts\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1.ContactsB\x03\xe0\x41\x02\"\xde\x01\n\x10SetConfigRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12S\n\x16tag_template_migration\x18\x02 \x01(\x0e\x32\x31.google.cloud.datacatalog.v1.TagTemplateMigrationH\x00\x12Q\n\x15\x63\x61talog_ui_experience\x18\x03 \x01(\x0e\x32\x30.google.cloud.datacatalog.v1.CatalogUIExperienceH\x00\x42\x0f\n\rconfiguration\"*\n\x15RetrieveConfigRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x1eRetrieveEffectiveConfigRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xbe\x01\n\x12OrganizationConfig\x12K\n\x06\x63onfig\x18\x01 \x03(\x0b\x32;.google.cloud.datacatalog.v1.OrganizationConfig.ConfigEntry\x1a[\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.datacatalog.v1.MigrationConfig:\x02\x38\x01\"\xb5\x01\n\x0fMigrationConfig\x12Q\n\x16tag_template_migration\x18\x01 \x01(\x0e\x32\x31.google.cloud.datacatalog.v1.TagTemplateMigration\x12O\n\x15\x63\x61talog_ui_experience\x18\x02 \x01(\x0e\x32\x30.google.cloud.datacatalog.v1.CatalogUIExperience*\xba\x02\n\tEntryType\x12\x1a\n\x16\x45NTRY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TABLE\x10\x02\x12\t\n\x05MODEL\x10\x05\x12\x0f\n\x0b\x44\x41TA_STREAM\x10\x03\x12\x0b\n\x07\x46ILESET\x10\x04\x12\x0b\n\x07\x43LUSTER\x10\x06\x12\x0c\n\x08\x44\x41TABASE\x10\x07\x12\x1a\n\x16\x44\x41TA_SOURCE_CONNECTION\x10\x08\x12\x0b\n\x07ROUTINE\x10\t\x12\x08\n\x04LAKE\x10\n\x12\x08\n\x04ZONE\x10\x0b\x12\x0b\n\x07SERVICE\x10\x0e\x12\x13\n\x0f\x44\x41TABASE_SCHEMA\x10\x0f\x12\r\n\tDASHBOARD\x10\x10\x12\x0b\n\x07\x45XPLORE\x10\x11\x12\x08\n\x04LOOK\x10\x12\x12\x18\n\x14\x46\x45\x41TURE_ONLINE_STORE\x10\x13\x12\x10\n\x0c\x46\x45\x41TURE_VIEW\x10\x14\x12\x11\n\rFEATURE_GROUP\x10\x15*\x87\x01\n\x14TagTemplateMigration\x12&\n\"TAG_TEMPLATE_MIGRATION_UNSPECIFIED\x10\x00\x12\"\n\x1eTAG_TEMPLATE_MIGRATION_ENABLED\x10\x01\x12#\n\x1fTAG_TEMPLATE_MIGRATION_DISABLED\x10\x02*\x83\x01\n\x13\x43\x61talogUIExperience\x12%\n!CATALOG_UI_EXPERIENCE_UNSPECIFIED\x10\x00\x12!\n\x1d\x43\x41TALOG_UI_EXPERIENCE_ENABLED\x10\x01\x12\"\n\x1e\x43\x41TALOG_UI_EXPERIENCE_DISABLED\x10\x02\x32\xde@\n\x0b\x44\x61taCatalog\x12\xa3\x01\n\rSearchCatalog\x12\x31.google.cloud.datacatalog.v1.SearchCatalogRequest\x1a\x32.google.cloud.datacatalog.v1.SearchCatalogResponse\"+\xda\x41\x0bscope,query\x82\xd3\xe4\x93\x02\x17\"\x12/v1/catalog:search:\x01*\x12\xdb\x01\n\x10\x43reateEntryGroup\x12\x34.google.cloud.datacatalog.v1.CreateEntryGroupRequest\x1a\'.google.cloud.datacatalog.v1.EntryGroup\"h\xda\x41!parent,entry_group_id,entry_group\x82\xd3\xe4\x93\x02>\"//v1/{parent=projects/*/locations/*}/entryGroups:\x0b\x65ntry_group\x12\xbc\x01\n\rGetEntryGroup\x12\x31.google.cloud.datacatalog.v1.GetEntryGroupRequest\x1a\'.google.cloud.datacatalog.v1.EntryGroup\"O\xda\x41\x04name\xda\x41\x0ename,read_mask\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/entryGroups/*}\x12\xeb\x01\n\x10UpdateEntryGroup\x12\x34.google.cloud.datacatalog.v1.UpdateEntryGroupRequest\x1a\'.google.cloud.datacatalog.v1.EntryGroup\"x\xda\x41\x0b\x65ntry_group\xda\x41\x17\x65ntry_group,update_mask\x82\xd3\xe4\x93\x02J2;/v1/{entry_group.name=projects/*/locations/*/entryGroups/*}:\x0b\x65ntry_group\x12\xa0\x01\n\x10\x44\x65leteEntryGroup\x12\x34.google.cloud.datacatalog.v1.DeleteEntryGroupRequest\x1a\x16.google.protobuf.Empty\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1/{name=projects/*/locations/*/entryGroups/*}\x12\xbe\x01\n\x0fListEntryGroups\x12\x33.google.cloud.datacatalog.v1.ListEntryGroupsRequest\x1a\x34.google.cloud.datacatalog.v1.ListEntryGroupsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=projects/*/locations/*}/entryGroups\x12\xc4\x01\n\x0b\x43reateEntry\x12/.google.cloud.datacatalog.v1.CreateEntryRequest\x1a\".google.cloud.datacatalog.v1.Entry\"`\xda\x41\x15parent,entry_id,entry\x82\xd3\xe4\x93\x02\x42\"9/v1/{parent=projects/*/locations/*/entryGroups/*}/entries:\x05\x65ntry\x12\xce\x01\n\x0bUpdateEntry\x12/.google.cloud.datacatalog.v1.UpdateEntryRequest\x1a\".google.cloud.datacatalog.v1.Entry\"j\xda\x41\x05\x65ntry\xda\x41\x11\x65ntry,update_mask\x82\xd3\xe4\x93\x02H2?/v1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}:\x05\x65ntry\x12\xa0\x01\n\x0b\x44\x65leteEntry\x12/.google.cloud.datacatalog.v1.DeleteEntryRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/entryGroups/*/entries/*}\x12\xa6\x01\n\x08GetEntry\x12,.google.cloud.datacatalog.v1.GetEntryRequest\x1a\".google.cloud.datacatalog.v1.Entry\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/entryGroups/*/entries/*}\x12~\n\x0bLookupEntry\x12/.google.cloud.datacatalog.v1.LookupEntryRequest\x1a\".google.cloud.datacatalog.v1.Entry\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/entries:lookup\x12\xbc\x01\n\x0bListEntries\x12/.google.cloud.datacatalog.v1.ListEntriesRequest\x1a\x30.google.cloud.datacatalog.v1.ListEntriesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/entryGroups/*}/entries\x12\xd4\x01\n\x13ModifyEntryOverview\x12\x37.google.cloud.datacatalog.v1.ModifyEntryOverviewRequest\x1a*.google.cloud.datacatalog.v1.EntryOverview\"X\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/entryGroups/*/entries/*}:modifyEntryOverview:\x01*\x12\xcf\x01\n\x13ModifyEntryContacts\x12\x37.google.cloud.datacatalog.v1.ModifyEntryContactsRequest\x1a%.google.cloud.datacatalog.v1.Contacts\"X\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/entryGroups/*/entries/*}:modifyEntryContacts:\x01*\x12\xe2\x01\n\x11\x43reateTagTemplate\x12\x35.google.cloud.datacatalog.v1.CreateTagTemplateRequest\x1a(.google.cloud.datacatalog.v1.TagTemplate\"l\xda\x41#parent,tag_template_id,tag_template\x82\xd3\xe4\x93\x02@\"0/v1/{parent=projects/*/locations/*}/tagTemplates:\x0ctag_template\x12\xaf\x01\n\x0eGetTagTemplate\x12\x32.google.cloud.datacatalog.v1.GetTagTemplateRequest\x1a(.google.cloud.datacatalog.v1.TagTemplate\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/tagTemplates/*}\x12\xf3\x01\n\x11UpdateTagTemplate\x12\x35.google.cloud.datacatalog.v1.UpdateTagTemplateRequest\x1a(.google.cloud.datacatalog.v1.TagTemplate\"}\xda\x41\x0ctag_template\xda\x41\x18tag_template,update_mask\x82\xd3\xe4\x93\x02M2=/v1/{tag_template.name=projects/*/locations/*/tagTemplates/*}:\x0ctag_template\x12\xa9\x01\n\x11\x44\x65leteTagTemplate\x12\x35.google.cloud.datacatalog.v1.DeleteTagTemplateRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\nname,force\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/locations/*/tagTemplates/*}\x12\x8d\x02\n\x16\x43reateTagTemplateField\x12:.google.cloud.datacatalog.v1.CreateTagTemplateFieldRequest\x1a-.google.cloud.datacatalog.v1.TagTemplateField\"\x87\x01\xda\x41/parent,tag_template_field_id,tag_template_field\x82\xd3\xe4\x93\x02O\"9/v1/{parent=projects/*/locations/*/tagTemplates/*}/fields:\x12tag_template_field\x12\x9b\x02\n\x16UpdateTagTemplateField\x12:.google.cloud.datacatalog.v1.UpdateTagTemplateFieldRequest\x1a-.google.cloud.datacatalog.v1.TagTemplateField\"\x95\x01\xda\x41\x17name,tag_template_field\xda\x41#name,tag_template_field,update_mask\x82\xd3\xe4\x93\x02O29/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:\x12tag_template_field\x12\xf1\x01\n\x16RenameTagTemplateField\x12:.google.cloud.datacatalog.v1.RenameTagTemplateFieldRequest\x1a-.google.cloud.datacatalog.v1.TagTemplateField\"l\xda\x41\x1ename,new_tag_template_field_id\x82\xd3\xe4\x93\x02\x45\"@/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename:\x01*\x12\x92\x02\n\x1fRenameTagTemplateFieldEnumValue\x12\x43.google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest\x1a-.google.cloud.datacatalog.v1.TagTemplateField\"{\xda\x41 name,new_enum_value_display_name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*/enumValues/*}:rename:\x01*\x12\xbc\x01\n\x16\x44\x65leteTagTemplateField\x12:.google.cloud.datacatalog.v1.DeleteTagTemplateFieldRequest\x1a\x16.google.protobuf.Empty\"N\xda\x41\nname,force\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/tagTemplates/*/fields/*}\x12\xf9\x01\n\tCreateTag\x12-.google.cloud.datacatalog.v1.CreateTagRequest\x1a .google.cloud.datacatalog.v1.Tag\"\x9a\x01\xda\x41\nparent,tag\x82\xd3\xe4\x93\x02\x86\x01\"@/v1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:\x03tagZ=\"6/v1/{parent=projects/*/locations/*/entryGroups/*}/tags:\x03tag\x12\x8c\x02\n\tUpdateTag\x12-.google.cloud.datacatalog.v1.UpdateTagRequest\x1a .google.cloud.datacatalog.v1.Tag\"\xad\x01\xda\x41\x03tag\xda\x41\x0ftag,update_mask\x82\xd3\xe4\x93\x02\x8e\x01\x32\x44/v1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}:\x03tagZA2:/v1/{tag.name=projects/*/locations/*/entryGroups/*/tags/*}:\x03tag\x12\xde\x01\n\tDeleteTag\x12-.google.cloud.datacatalog.v1.DeleteTagRequest\x1a\x16.google.protobuf.Empty\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|*@/v1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}Z8*6/v1/{name=projects/*/locations/*/entryGroups/*/tags/*}\x12\xf5\x01\n\x08ListTags\x12,.google.cloud.datacatalog.v1.ListTagsRequest\x1a-.google.cloud.datacatalog.v1.ListTagsResponse\"\x8b\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02|\x12@/v1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tagsZ8\x12\x36/v1/{parent=projects/*/locations/*/entryGroups/*}/tags\x12\xea\x01\n\rReconcileTags\x12\x31.google.cloud.datacatalog.v1.ReconcileTagsRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41.\n\x15ReconcileTagsResponse\x12\x15ReconcileTagsMetadata\x82\xd3\xe4\x93\x02O\"J/v1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:reconcile:\x01*\x12\xbc\x01\n\tStarEntry\x12-.google.cloud.datacatalog.v1.StarEntryRequest\x1a..google.cloud.datacatalog.v1.StarEntryResponse\"P\xda\x41\x04name\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/entryGroups/*/entries/*}:star:\x01*\x12\xc4\x01\n\x0bUnstarEntry\x12/.google.cloud.datacatalog.v1.UnstarEntryRequest\x1a\x30.google.cloud.datacatalog.v1.UnstarEntryResponse\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\"@/v1/{name=projects/*/locations/*/entryGroups/*/entries/*}:unstar:\x01*\x12\xf2\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xa6\x01\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x8d\x01\"A/v1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy:\x01*ZE\"@/v1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy:\x01*\x12\xbc\x02\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\xf0\x01\xda\x41\x08resource\x82\xd3\xe4\x93\x02\xde\x01\"A/v1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy:\x01*ZE\"@/v1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy:\x01*ZO\"J/v1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy:\x01*\x12\xe3\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xf7\x01\x82\xd3\xe4\x93\x02\xf0\x01\"G/v1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions:\x01*ZK\"F/v1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions:\x01*ZU\"P/v1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions:\x01*\x12\xdf\x01\n\rImportEntries\x12\x31.google.cloud.datacatalog.v1.ImportEntriesRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41.\n\x15ImportEntriesResponse\x12\x15ImportEntriesMetadata\x82\xd3\xe4\x93\x02\x45\"@/v1/{parent=projects/*/locations/*/entryGroups/*}/entries:import:\x01*\x12\xd7\x01\n\tSetConfig\x12-.google.cloud.datacatalog.v1.SetConfigRequest\x1a,.google.cloud.datacatalog.v1.MigrationConfig\"m\x82\xd3\xe4\x93\x02g\"0/v1/{name=organizations/*/locations/*}:setConfig:\x01*Z0\"+/v1/{name=projects/*/locations/*}:setConfig:\x01*\x12\xb4\x01\n\x0eRetrieveConfig\x12\x32.google.cloud.datacatalog.v1.RetrieveConfigRequest\x1a/.google.cloud.datacatalog.v1.OrganizationConfig\"=\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=organizations/*/locations/*}:retrieveConfig\x12\x8a\x02\n\x17RetrieveEffectiveConfig\x12;.google.cloud.datacatalog.v1.RetrieveEffectiveConfigRequest\x1a,.google.cloud.datacatalog.v1.MigrationConfig\"\x83\x01\x82\xd3\xe4\x93\x02}\x12>/v1/{name=organizations/*/locations/*}:retrieveEffectiveConfigZ;\x12\x39/v1/{name=projects/*/locations/*}:retrieveEffectiveConfig\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x87\x03\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1\xea\x41\xc0\x01\n4datacatalog.googleapis.com/TagTemplateFieldEnumValue\x12\x87\x01projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{tag_template_field_id}/enumValues/{enum_value_display_name}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.datacatalog.v1.SearchCatalogResult", "google/cloud/datacatalog/v1/search.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.datacatalog.v1.GcsFilesetSpec", "google/cloud/datacatalog/v1/gcs_fileset_spec.proto"], + ["google.cloud.datacatalog.v1.BigQueryTableSpec", "google/cloud/datacatalog/v1/table_spec.proto"], + ["google.cloud.datacatalog.v1.Schema", "google/cloud/datacatalog/v1/schema.proto"], + ["google.cloud.datacatalog.v1.SystemTimestamps", "google/cloud/datacatalog/v1/timestamps.proto"], + ["google.cloud.datacatalog.v1.UsageSignal", "google/cloud/datacatalog/v1/usage.proto"], + ["google.cloud.datacatalog.v1.DataSource", "google/cloud/datacatalog/v1/data_source.proto"], + ["google.cloud.datacatalog.v1.PersonalDetails", "google/cloud/datacatalog/v1/common.proto"], + ["google.cloud.datacatalog.v1.DataplexTableSpec", "google/cloud/datacatalog/v1/dataplex_spec.proto"], + ["google.cloud.datacatalog.v1.BigQueryConnectionSpec", "google/cloud/datacatalog/v1/bigquery.proto"], + ["google.cloud.datacatalog.v1.TagTemplate", "google/cloud/datacatalog/v1/tags.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DataCatalog + module V1 + SearchCatalogRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SearchCatalogRequest").msgclass + SearchCatalogRequest::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SearchCatalogRequest.Scope").msgclass + SearchCatalogResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SearchCatalogResponse").msgclass + CreateEntryGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreateEntryGroupRequest").msgclass + UpdateEntryGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdateEntryGroupRequest").msgclass + GetEntryGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GetEntryGroupRequest").msgclass + DeleteEntryGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeleteEntryGroupRequest").msgclass + ListEntryGroupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListEntryGroupsRequest").msgclass + ListEntryGroupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListEntryGroupsResponse").msgclass + CreateEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreateEntryRequest").msgclass + UpdateEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdateEntryRequest").msgclass + DeleteEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeleteEntryRequest").msgclass + GetEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GetEntryRequest").msgclass + LookupEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.LookupEntryRequest").msgclass + Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Entry").msgclass + DatabaseTableSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DatabaseTableSpec").msgclass + DatabaseTableSpec::DatabaseViewSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec").msgclass + DatabaseTableSpec::DatabaseViewSpec::ViewType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType").enummodule + DatabaseTableSpec::TableType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DatabaseTableSpec.TableType").enummodule + FilesetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FilesetSpec").msgclass + DataSourceConnectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataSourceConnectionSpec").msgclass + RoutineSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RoutineSpec").msgclass + RoutineSpec::Argument = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RoutineSpec.Argument").msgclass + RoutineSpec::Argument::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RoutineSpec.Argument.Mode").enummodule + RoutineSpec::RoutineType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RoutineSpec.RoutineType").enummodule + DatasetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DatasetSpec").msgclass + SqlDatabaseSystemSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SqlDatabaseSystemSpec").msgclass + LookerSystemSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.LookerSystemSpec").msgclass + CloudBigtableSystemSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CloudBigtableSystemSpec").msgclass + CloudBigtableInstanceSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CloudBigtableInstanceSpec").msgclass + CloudBigtableInstanceSpec::CloudBigtableClusterSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec").msgclass + ServiceSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ServiceSpec").msgclass + VertexModelSourceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.VertexModelSourceInfo").msgclass + VertexModelSourceInfo::ModelSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.VertexModelSourceInfo.ModelSourceType").enummodule + VertexModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.VertexModelSpec").msgclass + VertexDatasetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.VertexDatasetSpec").msgclass + VertexDatasetSpec::DataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.VertexDatasetSpec.DataType").enummodule + ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ModelSpec").msgclass + FeatureOnlineStoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FeatureOnlineStoreSpec").msgclass + FeatureOnlineStoreSpec::StorageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FeatureOnlineStoreSpec.StorageType").enummodule + BusinessContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.BusinessContext").msgclass + EntryOverview = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.EntryOverview").msgclass + Contacts = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Contacts").msgclass + Contacts::Person = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Contacts.Person").msgclass + EntryGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.EntryGroup").msgclass + CreateTagTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreateTagTemplateRequest").msgclass + GetTagTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GetTagTemplateRequest").msgclass + UpdateTagTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdateTagTemplateRequest").msgclass + DeleteTagTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeleteTagTemplateRequest").msgclass + CreateTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreateTagRequest").msgclass + UpdateTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdateTagRequest").msgclass + DeleteTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeleteTagRequest").msgclass + CreateTagTemplateFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreateTagTemplateFieldRequest").msgclass + UpdateTagTemplateFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdateTagTemplateFieldRequest").msgclass + RenameTagTemplateFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RenameTagTemplateFieldRequest").msgclass + RenameTagTemplateFieldEnumValueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest").msgclass + DeleteTagTemplateFieldRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeleteTagTemplateFieldRequest").msgclass + ListTagsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListTagsRequest").msgclass + ListTagsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListTagsResponse").msgclass + ReconcileTagsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ReconcileTagsRequest").msgclass + ReconcileTagsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ReconcileTagsResponse").msgclass + ReconcileTagsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ReconcileTagsMetadata").msgclass + ReconcileTagsMetadata::ReconciliationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState").enummodule + ListEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListEntriesRequest").msgclass + ListEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListEntriesResponse").msgclass + StarEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.StarEntryRequest").msgclass + StarEntryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.StarEntryResponse").msgclass + UnstarEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UnstarEntryRequest").msgclass + UnstarEntryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UnstarEntryResponse").msgclass + ImportEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ImportEntriesRequest").msgclass + ImportEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ImportEntriesResponse").msgclass + ImportEntriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ImportEntriesMetadata").msgclass + ImportEntriesMetadata::ImportState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState").enummodule + ModifyEntryOverviewRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ModifyEntryOverviewRequest").msgclass + ModifyEntryContactsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ModifyEntryContactsRequest").msgclass + SetConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SetConfigRequest").msgclass + RetrieveConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RetrieveConfigRequest").msgclass + RetrieveEffectiveConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.RetrieveEffectiveConfigRequest").msgclass + OrganizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.OrganizationConfig").msgclass + MigrationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.MigrationConfig").msgclass + EntryType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.EntryType").enummodule + TagTemplateMigration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TagTemplateMigration").enummodule + CatalogUIExperience = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CatalogUIExperience").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb new file mode 100644 index 000000000000..81b4bbfbe99e --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/datacatalog_services_pb.rb @@ -0,0 +1,345 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/datacatalog/v1/datacatalog.proto for package 'Google.Cloud.DataCatalog.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/datacatalog/v1/datacatalog_pb' + +module Google + module Cloud + module DataCatalog + module V1 + module DataCatalog + # Data Catalog API service allows you to discover, understand, and manage + # your data. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.datacatalog.v1.DataCatalog' + + # Searches Data Catalog for multiple resources like entries and tags that + # match a query. + # + # This is a [Custom Method] + # (https://cloud.google.com/apis/design/custom_methods) that doesn't return + # all information on a resource, only its ID and high level fields. To get + # more information, you can subsequently call specific get methods. + # + # Note: Data Catalog search queries don't guarantee full recall. Results + # that match your query might not be returned, even in subsequent + # result pages. Additionally, returned (and not returned) results can vary + # if you repeat search queries. + # + # For more information, see [Data Catalog search syntax] + # (https://cloud.google.com/data-catalog/docs/how-to/search-reference). + rpc :SearchCatalog, ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest, ::Google::Cloud::DataCatalog::V1::SearchCatalogResponse + # Creates an entry group. + # + # An entry group contains logically related entries together with [Cloud + # Identity and Access Management](/data-catalog/docs/concepts/iam) policies. + # These policies specify users who can create, edit, and view entries + # within entry groups. + # + # Data Catalog automatically creates entry groups with names that start with + # the `@` symbol for the following resources: + # + # * BigQuery entries (`@bigquery`) + # * Pub/Sub topics (`@pubsub`) + # * Dataproc Metastore services (`@dataproc_metastore_{SERVICE_NAME_HASH}`) + # + # You can create your own entry groups for Cloud Storage fileset entries + # and custom entries together with the corresponding IAM policies. + # User-created entry groups can't contain the `@` symbol, it is reserved + # for automatically created groups. + # + # Entry groups, like entries, can be searched. + # + # A maximum of 10,000 entry groups may be created per organization across all + # locations. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :CreateEntryGroup, ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest, ::Google::Cloud::DataCatalog::V1::EntryGroup + # Gets an entry group. + rpc :GetEntryGroup, ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest, ::Google::Cloud::DataCatalog::V1::EntryGroup + # Updates an entry group. + # + # You must enable the Data Catalog API in the project identified by + # the `entry_group.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :UpdateEntryGroup, ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest, ::Google::Cloud::DataCatalog::V1::EntryGroup + # Deletes an entry group. + # + # You must enable the Data Catalog API in the project + # identified by the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :DeleteEntryGroup, ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest, ::Google::Protobuf::Empty + # Lists entry groups. + rpc :ListEntryGroups, ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest, ::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse + # Creates an entry. + # + # You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', + # or custom types. Data Catalog automatically creates entries with other + # types during metadata ingestion from integrated systems. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + # + # An entry group can have a maximum of 100,000 entries. + rpc :CreateEntry, ::Google::Cloud::DataCatalog::V1::CreateEntryRequest, ::Google::Cloud::DataCatalog::V1::Entry + # Updates an existing entry. + # + # You must enable the Data Catalog API in the project identified by + # the `entry.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :UpdateEntry, ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest, ::Google::Cloud::DataCatalog::V1::Entry + # Deletes an existing entry. + # + # You can delete only the entries created by the + # [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] + # method. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :DeleteEntry, ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest, ::Google::Protobuf::Empty + # Gets an entry. + rpc :GetEntry, ::Google::Cloud::DataCatalog::V1::GetEntryRequest, ::Google::Cloud::DataCatalog::V1::Entry + # Gets an entry by its target resource name. + # + # The resource name comes from the source Google Cloud Platform service. + rpc :LookupEntry, ::Google::Cloud::DataCatalog::V1::LookupEntryRequest, ::Google::Cloud::DataCatalog::V1::Entry + # Lists entries. + # + # Note: Currently, this method can list only custom entries. + # To get a list of both custom and automatically created entries, use + # [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]. + rpc :ListEntries, ::Google::Cloud::DataCatalog::V1::ListEntriesRequest, ::Google::Cloud::DataCatalog::V1::ListEntriesResponse + # Modifies entry overview, part of the business context of an + # [Entry][google.cloud.datacatalog.v1.Entry]. + # + # To call this method, you must have the `datacatalog.entries.updateOverview` + # IAM permission on the corresponding project. + rpc :ModifyEntryOverview, ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest, ::Google::Cloud::DataCatalog::V1::EntryOverview + # Modifies contacts, part of the business context of an + # [Entry][google.cloud.datacatalog.v1.Entry]. + # + # To call this method, you must have the `datacatalog.entries.updateContacts` + # IAM permission on the corresponding project. + rpc :ModifyEntryContacts, ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest, ::Google::Cloud::DataCatalog::V1::Contacts + # Creates a tag template. + # + # You must enable the Data Catalog API in the project identified by the + # `parent` parameter. + # For more information, see [Data Catalog resource project] + # (https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :CreateTagTemplate, ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest, ::Google::Cloud::DataCatalog::V1::TagTemplate + # Gets a tag template. + rpc :GetTagTemplate, ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest, ::Google::Cloud::DataCatalog::V1::TagTemplate + # Updates a tag template. + # + # You can't update template fields with this method. These fields are + # separate resources with their own create, update, and delete methods. + # + # You must enable the Data Catalog API in the project identified by + # the `tag_template.name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :UpdateTagTemplate, ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest, ::Google::Cloud::DataCatalog::V1::TagTemplate + # Deletes a tag template and all tags that use it. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :DeleteTagTemplate, ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest, ::Google::Protobuf::Empty + # Creates a field in a tag template. + # + # You must enable the Data Catalog API in the project identified by + # the `parent` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :CreateTagTemplateField, ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest, ::Google::Cloud::DataCatalog::V1::TagTemplateField + # Updates a field in a tag template. + # + # You can't update the field type with this method. + # + # You must enable the Data Catalog API in the project + # identified by the `name` parameter. For more information, see [Data Catalog + # resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :UpdateTagTemplateField, ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest, ::Google::Cloud::DataCatalog::V1::TagTemplateField + # Renames a field in a tag template. + # + # You must enable the Data Catalog API in the project identified by the + # `name` parameter. For more information, see [Data Catalog resource project] + # (https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :RenameTagTemplateField, ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest, ::Google::Cloud::DataCatalog::V1::TagTemplateField + # Renames an enum value in a tag template. + # + # Within a single enum field, enum values must be unique. + rpc :RenameTagTemplateFieldEnumValue, ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest, ::Google::Cloud::DataCatalog::V1::TagTemplateField + # Deletes a field in a tag template and all uses of this field from the tags + # based on this template. + # + # You must enable the Data Catalog API in the project identified by + # the `name` parameter. For more information, see [Data Catalog resource + # project](https://cloud.google.com/data-catalog/docs/concepts/resource-project). + rpc :DeleteTagTemplateField, ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest, ::Google::Protobuf::Empty + # Creates a tag and assigns it to: + # + # * An [Entry][google.cloud.datacatalog.v1.Entry] if the method name is + # `projects.locations.entryGroups.entries.tags.create`. + # * Or [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]if the method + # name is `projects.locations.entryGroups.tags.create`. + # + # Note: The project identified by the `parent` parameter for the [tag] + # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) + # and the [tag template] + # (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) + # used to create the tag must be in the same organization. + rpc :CreateTag, ::Google::Cloud::DataCatalog::V1::CreateTagRequest, ::Google::Cloud::DataCatalog::V1::Tag + # Updates an existing tag. + rpc :UpdateTag, ::Google::Cloud::DataCatalog::V1::UpdateTagRequest, ::Google::Cloud::DataCatalog::V1::Tag + # Deletes a tag. + rpc :DeleteTag, ::Google::Cloud::DataCatalog::V1::DeleteTagRequest, ::Google::Protobuf::Empty + # Lists tags assigned to an [Entry][google.cloud.datacatalog.v1.Entry]. + # The [columns][google.cloud.datacatalog.v1.Tag.column] in the response are + # lowercased. + rpc :ListTags, ::Google::Cloud::DataCatalog::V1::ListTagsRequest, ::Google::Cloud::DataCatalog::V1::ListTagsResponse + # `ReconcileTags` creates or updates a list of tags on the entry. + # If the + # [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] + # parameter is set, the operation deletes tags not included in the input tag + # list. + # + # `ReconcileTags` returns a [long-running operation] + # [google.longrunning.Operation] resource that can be queried with + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] + # to return [ReconcileTagsMetadata] + # [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and + # a [ReconcileTagsResponse] + # [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. + rpc :ReconcileTags, ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest, ::Google::Longrunning::Operation + # Marks an [Entry][google.cloud.datacatalog.v1.Entry] as starred by + # the current user. Starring information is private to each user. + rpc :StarEntry, ::Google::Cloud::DataCatalog::V1::StarEntryRequest, ::Google::Cloud::DataCatalog::V1::StarEntryResponse + # Marks an [Entry][google.cloud.datacatalog.v1.Entry] as NOT starred by + # the current user. Starring information is private to each user. + rpc :UnstarEntry, ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest, ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse + # Sets an access control policy for a resource. Replaces any existing + # policy. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method sets policies only within Data Catalog and can't be + # used to manage policies in BigQuery, Pub/Sub, Dataproc Metastore, and any + # external Google Cloud Platform resources synced with the Data Catalog. + # + # To call this method, you must have the following Google IAM permissions: + # + # - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag + # templates. + # - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for a resource. + # + # May return: + # + # * A`NOT_FOUND` error if the resource doesn't exist or you don't have the + # permission to view it. + # * An empty policy if the resource exists but doesn't have a set policy. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method doesn't get policies from Google Cloud Platform + # resources ingested into Data Catalog. + # + # To call this method, you must have the following Google IAM permissions: + # + # - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag + # templates. + # - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets your permissions on a resource. + # + # Returns an empty set of permissions if the resource doesn't exist. + # + # Supported resources are: + # + # - Tag templates + # - Entry groups + # + # Note: This method gets policies only within Data Catalog and can't be + # used to get policies from BigQuery, Pub/Sub, Dataproc Metastore, and any + # external Google Cloud Platform resources ingested into Data Catalog. + # + # No Google IAM permissions are required to call this method. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Imports entries from a source, such as data previously dumped into a + # Cloud Storage bucket, into Data Catalog. Import of entries + # is a sync operation that reconciles the state of the third-party system + # with the Data Catalog. + # + # `ImportEntries` accepts source data snapshots of a third-party system. + # Snapshot should be delivered as a .wire or base65-encoded .txt file + # containing a sequence of Protocol Buffer messages of + # [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. + # + # `ImportEntries` returns a [long-running operation] + # [google.longrunning.Operation] resource that can be queried with + # [Operations.GetOperation][google.longrunning.Operations.GetOperation] + # to return + # [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] + # and an + # [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] + # message. + rpc :ImportEntries, ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest, ::Google::Longrunning::Operation + # Sets the configuration related to the migration to Dataplex for an + # organization or project. + rpc :SetConfig, ::Google::Cloud::DataCatalog::V1::SetConfigRequest, ::Google::Cloud::DataCatalog::V1::MigrationConfig + # Retrieves the configuration related to the migration from Data Catalog to + # Dataplex for a specific organization, including all the projects under it + # which have a separate configuration set. + rpc :RetrieveConfig, ::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest, ::Google::Cloud::DataCatalog::V1::OrganizationConfig + # Retrieves the effective configuration related to the migration from Data + # Catalog to Dataplex for a specific organization or project. If there is no + # specific configuration set for the resource, the setting is checked + # hierarchicahlly through the ancestors of the resource, starting from the + # resource itself. + rpc :RetrieveEffectiveConfig, ::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest, ::Google::Cloud::DataCatalog::V1::MigrationConfig + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/dataplex_spec_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/dataplex_spec_pb.rb new file mode 100644 index 000000000000..32ff2e2ed744 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/dataplex_spec_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/dataplex_spec.proto + +require 'google/protobuf' + +require 'google/cloud/datacatalog/v1/common_pb' +require 'google/cloud/datacatalog/v1/physical_schema_pb' + + +descriptor_data = "\n/google/cloud/datacatalog/v1/dataplex_spec.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a(google/cloud/datacatalog/v1/common.proto\x1a\x31google/cloud/datacatalog/v1/physical_schema.proto\"\x8f\x01\n\x0c\x44\x61taplexSpec\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12@\n\x0b\x64\x61ta_format\x18\x02 \x01(\x0b\x32+.google.cloud.datacatalog.v1.PhysicalSchema\x12\x1a\n\x12\x63ompression_format\x18\x03 \x01(\t\x12\x12\n\nproject_id\x18\x04 \x01(\t\"W\n\x13\x44\x61taplexFilesetSpec\x12@\n\rdataplex_spec\x18\x01 \x01(\x0b\x32).google.cloud.datacatalog.v1.DataplexSpec\"\xb8\x01\n\x11\x44\x61taplexTableSpec\x12K\n\x0f\x65xternal_tables\x18\x01 \x03(\x0b\x32\x32.google.cloud.datacatalog.v1.DataplexExternalTable\x12@\n\rdataplex_spec\x18\x02 \x01(\x0b\x32).google.cloud.datacatalog.v1.DataplexSpec\x12\x14\n\x0cuser_managed\x18\x03 \x01(\x08\"\xaf\x01\n\x15\x44\x61taplexExternalTable\x12=\n\x06system\x18\x01 \x01(\x0e\x32-.google.cloud.datacatalog.v1.IntegratedSystem\x12\x1c\n\x14\x66ully_qualified_name\x18\x1c \x01(\t\x12\x1d\n\x15google_cloud_resource\x18\x03 \x01(\t\x12\x1a\n\x12\x64\x61ta_catalog_entry\x18\x04 \x01(\tB\xd6\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\x11\x44\x61taplexSpecProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.datacatalog.v1.PhysicalSchema", "google/cloud/datacatalog/v1/physical_schema.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 DataCatalog + module V1 + DataplexSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataplexSpec").msgclass + DataplexFilesetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataplexFilesetSpec").msgclass + DataplexTableSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataplexTableSpec").msgclass + DataplexExternalTable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DataplexExternalTable").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/dump_content_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/dump_content_pb.rb new file mode 100644 index 000000000000..d1aeac9eb018 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/dump_content_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/dump_content.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/datacatalog/v1/datacatalog_pb' +require 'google/cloud/datacatalog/v1/tags_pb' + + +descriptor_data = "\n.google/cloud/datacatalog/v1/dump_content.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a-google/cloud/datacatalog/v1/datacatalog.proto\x1a&google/cloud/datacatalog/v1/tags.proto\"\xc7\x01\n\x0bTaggedEntry\x12\x36\n\x08v1_entry\x18\x01 \x01(\x0b\x32\".google.cloud.datacatalog.v1.EntryH\x00\x12;\n\x0cpresent_tags\x18\x02 \x03(\x0b\x32 .google.cloud.datacatalog.v1.TagB\x03\xe0\x41\x01\x12:\n\x0b\x61\x62sent_tags\x18\x03 \x03(\x0b\x32 .google.cloud.datacatalog.v1.TagB\x03\xe0\x41\x01\x42\x07\n\x05\x65ntry\"T\n\x08\x44umpItem\x12@\n\x0ctagged_entry\x18\x01 \x01(\x0b\x32(.google.cloud.datacatalog.v1.TaggedEntryH\x00\x42\x06\n\x04itemB\xd5\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\x10\x44umpContentProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.datacatalog.v1.Entry", "google/cloud/datacatalog/v1/datacatalog.proto"], + ["google.cloud.datacatalog.v1.Tag", "google/cloud/datacatalog/v1/tags.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 DataCatalog + module V1 + TaggedEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TaggedEntry").msgclass + DumpItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DumpItem").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/gcs_fileset_spec_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/gcs_fileset_spec_pb.rb new file mode 100644 index 000000000000..062b50716591 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/gcs_fileset_spec_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/gcs_fileset_spec.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/datacatalog/v1/timestamps_pb' + + +descriptor_data = "\n2google/cloud/datacatalog/v1/gcs_fileset_spec.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/datacatalog/v1/timestamps.proto\"z\n\x0eGcsFilesetSpec\x12\x1a\n\rfile_patterns\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12L\n\x15sample_gcs_file_specs\x18\x02 \x03(\x0b\x32(.google.cloud.datacatalog.v1.GcsFileSpecB\x03\xe0\x41\x03\"\x8a\x01\n\x0bGcsFileSpec\x12\x16\n\tfile_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x0egcs_timestamps\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1.SystemTimestampsB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x42\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.datacatalog.v1.SystemTimestamps", "google/cloud/datacatalog/v1/timestamps.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 DataCatalog + module V1 + GcsFilesetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GcsFilesetSpec").msgclass + GcsFileSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GcsFileSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/physical_schema_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/physical_schema_pb.rb new file mode 100644 index 000000000000..7b0e8a3c086a --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/physical_schema_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/physical_schema.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/datacatalog/v1/physical_schema.proto\x12\x1bgoogle.cloud.datacatalog.v1\"\xdd\x04\n\x0ePhysicalSchema\x12\x46\n\x04\x61vro\x18\x01 \x01(\x0b\x32\x36.google.cloud.datacatalog.v1.PhysicalSchema.AvroSchemaH\x00\x12J\n\x06thrift\x18\x02 \x01(\x0b\x32\x38.google.cloud.datacatalog.v1.PhysicalSchema.ThriftSchemaH\x00\x12N\n\x08protobuf\x18\x03 \x01(\x0b\x32:.google.cloud.datacatalog.v1.PhysicalSchema.ProtobufSchemaH\x00\x12L\n\x07parquet\x18\x04 \x01(\x0b\x32\x39.google.cloud.datacatalog.v1.PhysicalSchema.ParquetSchemaH\x00\x12\x44\n\x03orc\x18\x05 \x01(\x0b\x32\x35.google.cloud.datacatalog.v1.PhysicalSchema.OrcSchemaH\x00\x12\x44\n\x03\x63sv\x18\x06 \x01(\x0b\x32\x35.google.cloud.datacatalog.v1.PhysicalSchema.CsvSchemaH\x00\x1a\x1a\n\nAvroSchema\x12\x0c\n\x04text\x18\x01 \x01(\t\x1a\x1c\n\x0cThriftSchema\x12\x0c\n\x04text\x18\x01 \x01(\t\x1a\x1e\n\x0eProtobufSchema\x12\x0c\n\x04text\x18\x01 \x01(\t\x1a\x0f\n\rParquetSchema\x1a\x0b\n\tOrcSchema\x1a\x0b\n\tCsvSchemaB\x08\n\x06schemaB\xd8\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\x13PhysicalSchemaProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + 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 DataCatalog + module V1 + PhysicalSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema").msgclass + PhysicalSchema::AvroSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema.AvroSchema").msgclass + PhysicalSchema::ThriftSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema.ThriftSchema").msgclass + PhysicalSchema::ProtobufSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema.ProtobufSchema").msgclass + PhysicalSchema::ParquetSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema.ParquetSchema").msgclass + PhysicalSchema::OrcSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema.OrcSchema").msgclass + PhysicalSchema::CsvSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PhysicalSchema.CsvSchema").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb new file mode 100644 index 000000000000..408baa71d4b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanager_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/policytagmanager.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/datacatalog/v1/common_pb' +require 'google/cloud/datacatalog/v1/timestamps_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n2google/cloud/datacatalog/v1/policytagmanager.proto\x12\x1bgoogle.cloud.datacatalog.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/datacatalog/v1/common.proto\x1a,google/cloud/datacatalog/v1/timestamps.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xeb\x04\n\x08Taxonomy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10policy_tag_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12O\n\x13taxonomy_timestamps\x18\x05 \x01(\x0b\x32-.google.cloud.datacatalog.v1.SystemTimestampsB\x03\xe0\x41\x03\x12U\n\x16\x61\x63tivated_policy_types\x18\x06 \x03(\x0e\x32\x30.google.cloud.datacatalog.v1.Taxonomy.PolicyTypeB\x03\xe0\x41\x01\x12\x43\n\x07service\x18\x07 \x01(\x0b\x32-.google.cloud.datacatalog.v1.Taxonomy.ServiceB\x03\xe0\x41\x03\x1aV\n\x07Service\x12\x39\n\x04name\x18\x01 \x01(\x0e\x32+.google.cloud.datacatalog.v1.ManagingSystem\x12\x10\n\x08identity\x18\x02 \x01(\t\"J\n\nPolicyType\x12\x1b\n\x17POLICY_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x46INE_GRAINED_ACCESS_CONTROL\x10\x01:g\xea\x41\x64\n#datacatalog.googleapis.com/Taxonomy\x12=projects/{project}/locations/{location}/taxonomies/{taxonomy}\"\x8c\x02\n\tPolicyTag\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x19\n\x11parent_policy_tag\x18\x04 \x01(\t\x12\x1e\n\x11\x63hild_policy_tags\x18\x05 \x03(\tB\x03\xe0\x41\x03:\x80\x01\xea\x41}\n$datacatalog.googleapis.com/PolicyTag\x12Uprojects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}\"\x8d\x01\n\x15\x43reateTaxonomyRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12\x37\n\x08taxonomy\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1.Taxonomy\"R\n\x15\x44\x65leteTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\"\x81\x01\n\x15UpdateTaxonomyRequest\x12\x37\n\x08taxonomy\x18\x01 \x01(\x0b\x32%.google.cloud.datacatalog.v1.Taxonomy\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x8b\x01\n\x15ListTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"l\n\x16ListTaxonomiesResponse\x12\x39\n\ntaxonomies\x18\x01 \x03(\x0b\x32%.google.cloud.datacatalog.v1.Taxonomy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x12GetTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\"\x92\x01\n\x16\x43reatePolicyTagRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$datacatalog.googleapis.com/PolicyTag\x12:\n\npolicy_tag\x18\x02 \x01(\x0b\x32&.google.cloud.datacatalog.v1.PolicyTag\"T\n\x16\x44\x65letePolicyTagRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$datacatalog.googleapis.com/PolicyTag\"\x85\x01\n\x16UpdatePolicyTagRequest\x12:\n\npolicy_tag\x18\x01 \x01(\x0b\x32&.google.cloud.datacatalog.v1.PolicyTag\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"|\n\x15ListPolicyTagsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$datacatalog.googleapis.com/PolicyTag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"n\n\x16ListPolicyTagsResponse\x12;\n\x0bpolicy_tags\x18\x01 \x03(\x0b\x32&.google.cloud.datacatalog.v1.PolicyTag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Q\n\x13GetPolicyTagRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$datacatalog.googleapis.com/PolicyTag2\xbb\x15\n\x10PolicyTagManager\x12\xbf\x01\n\x0e\x43reateTaxonomy\x12\x32.google.cloud.datacatalog.v1.CreateTaxonomyRequest\x1a%.google.cloud.datacatalog.v1.Taxonomy\"R\xda\x41\x0fparent,taxonomy\x82\xd3\xe4\x93\x02:\"./v1/{parent=projects/*/locations/*}/taxonomies:\x08taxonomy\x12\x9b\x01\n\x0e\x44\x65leteTaxonomy\x12\x32.google.cloud.datacatalog.v1.DeleteTaxonomyRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/taxonomies/*}\x12\xc1\x01\n\x0eUpdateTaxonomy\x12\x32.google.cloud.datacatalog.v1.UpdateTaxonomyRequest\x1a%.google.cloud.datacatalog.v1.Taxonomy\"T\xda\x41\x08taxonomy\x82\xd3\xe4\x93\x02\x43\x32\x37/v1/{taxonomy.name=projects/*/locations/*/taxonomies/*}:\x08taxonomy\x12\xba\x01\n\x0eListTaxonomies\x12\x32.google.cloud.datacatalog.v1.ListTaxonomiesRequest\x1a\x33.google.cloud.datacatalog.v1.ListTaxonomiesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/taxonomies\x12\xa4\x01\n\x0bGetTaxonomy\x12/.google.cloud.datacatalog.v1.GetTaxonomyRequest\x1a%.google.cloud.datacatalog.v1.Taxonomy\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/taxonomies/*}\x12\xd3\x01\n\x0f\x43reatePolicyTag\x12\x33.google.cloud.datacatalog.v1.CreatePolicyTagRequest\x1a&.google.cloud.datacatalog.v1.PolicyTag\"c\xda\x41\x11parent,policy_tag\x82\xd3\xe4\x93\x02I\";/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags:\npolicy_tag\x12\xaa\x01\n\x0f\x44\x65letePolicyTag\x12\x33.google.cloud.datacatalog.v1.DeletePolicyTagRequest\x1a\x16.google.protobuf.Empty\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}\x12\xd7\x01\n\x0fUpdatePolicyTag\x12\x33.google.cloud.datacatalog.v1.UpdatePolicyTagRequest\x1a&.google.cloud.datacatalog.v1.PolicyTag\"g\xda\x41\npolicy_tag\x82\xd3\xe4\x93\x02T2F/v1/{policy_tag.name=projects/*/locations/*/taxonomies/*/policyTags/*}:\npolicy_tag\x12\xc7\x01\n\x0eListPolicyTags\x12\x32.google.cloud.datacatalog.v1.ListPolicyTagsRequest\x1a\x33.google.cloud.datacatalog.v1.ListPolicyTagsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*/taxonomies/*}/policyTags\x12\xb4\x01\n\x0cGetPolicyTag\x12\x30.google.cloud.datacatalog.v1.GetPolicyTagRequest\x1a&.google.cloud.datacatalog.v1.PolicyTag\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/taxonomies/*/policyTags/*}\x12\xea\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x9e\x01\x82\xd3\xe4\x93\x02\x97\x01\"?/v1/{resource=projects/*/locations/*/taxonomies/*}:getIamPolicy:\x01*ZQ\"L/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:getIamPolicy:\x01*\x12\xea\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"\x9e\x01\x82\xd3\xe4\x93\x02\x97\x01\"?/v1/{resource=projects/*/locations/*/taxonomies/*}:setIamPolicy:\x01*ZQ\"L/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:setIamPolicy:\x01*\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\x82\xd3\xe4\x93\x02\xa3\x01\"E/v1/{resource=projects/*/locations/*/taxonomies/*}:testIamPermissions:\x01*ZW\"R/v1/{resource=projects/*/locations/*/taxonomies/*/policyTags/*}:testIamPermissions:\x01*\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xda\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\x15PolicyTagManagerProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.datacatalog.v1.SystemTimestamps", "google/cloud/datacatalog/v1/timestamps.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 DataCatalog + module V1 + Taxonomy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Taxonomy").msgclass + Taxonomy::Service = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Taxonomy.Service").msgclass + Taxonomy::PolicyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Taxonomy.PolicyType").enummodule + PolicyTag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.PolicyTag").msgclass + CreateTaxonomyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreateTaxonomyRequest").msgclass + DeleteTaxonomyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeleteTaxonomyRequest").msgclass + UpdateTaxonomyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdateTaxonomyRequest").msgclass + ListTaxonomiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListTaxonomiesRequest").msgclass + ListTaxonomiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListTaxonomiesResponse").msgclass + GetTaxonomyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GetTaxonomyRequest").msgclass + CreatePolicyTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CreatePolicyTagRequest").msgclass + DeletePolicyTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.DeletePolicyTagRequest").msgclass + UpdatePolicyTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UpdatePolicyTagRequest").msgclass + ListPolicyTagsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListPolicyTagsRequest").msgclass + ListPolicyTagsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ListPolicyTagsResponse").msgclass + GetPolicyTagRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.GetPolicyTagRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanager_services_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanager_services_pb.rb new file mode 100644 index 000000000000..55d8b4fc588b --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanager_services_pb.rb @@ -0,0 +1,87 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/datacatalog/v1/policytagmanager.proto for package 'Google.Cloud.DataCatalog.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/datacatalog/v1/policytagmanager_pb' + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManager + # Policy Tag Manager API service allows you to manage your policy tags and + # taxonomies. + # + # Policy tags are used to tag BigQuery columns and apply additional access + # control policies. A taxonomy is a hierarchical grouping of policy tags that + # classify data along a common axis. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.datacatalog.v1.PolicyTagManager' + + # Creates a taxonomy in a specified project. + # + # The taxonomy is initially empty, that is, it doesn't contain policy tags. + rpc :CreateTaxonomy, ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest, ::Google::Cloud::DataCatalog::V1::Taxonomy + # Deletes a taxonomy, including all policy tags in this + # taxonomy, their associated policies, and the policy tags references from + # BigQuery columns. + rpc :DeleteTaxonomy, ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest, ::Google::Protobuf::Empty + # Updates a taxonomy, including its display name, + # description, and activated policy types. + rpc :UpdateTaxonomy, ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest, ::Google::Cloud::DataCatalog::V1::Taxonomy + # Lists all taxonomies in a project in a particular location that you + # have a permission to view. + rpc :ListTaxonomies, ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest, ::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse + # Gets a taxonomy. + rpc :GetTaxonomy, ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, ::Google::Cloud::DataCatalog::V1::Taxonomy + # Creates a policy tag in a taxonomy. + rpc :CreatePolicyTag, ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, ::Google::Cloud::DataCatalog::V1::PolicyTag + # Deletes a policy tag together with the following: + # + # * All of its descendant policy tags, if any + # * Policies associated with the policy tag and its descendants + # * References from BigQuery table schema of the policy tag and its + # descendants + rpc :DeletePolicyTag, ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, ::Google::Protobuf::Empty + # Updates a policy tag, including its display + # name, description, and parent policy tag. + rpc :UpdatePolicyTag, ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, ::Google::Cloud::DataCatalog::V1::PolicyTag + # Lists all policy tags in a taxonomy. + rpc :ListPolicyTags, ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, ::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse + # Gets a policy tag. + rpc :GetPolicyTag, ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, ::Google::Cloud::DataCatalog::V1::PolicyTag + # Gets the IAM policy for a policy tag or a taxonomy. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the IAM policy for a policy tag or a taxonomy. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns your permissions on a specified policy tag or + # taxonomy. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_pb.rb new file mode 100644 index 000000000000..04d15ab5c660 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/policytagmanagerserialization.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/datacatalog/v1/policytagmanager_pb' + + +descriptor_data = "\n?google/cloud/datacatalog/v1/policytagmanagerserialization.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/datacatalog/v1/policytagmanager.proto\"\xdd\x01\n\x12SerializedTaxonomy\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x45\n\x0bpolicy_tags\x18\x03 \x03(\x0b\x32\x30.google.cloud.datacatalog.v1.SerializedPolicyTag\x12P\n\x16\x61\x63tivated_policy_types\x18\x04 \x03(\x0e\x32\x30.google.cloud.datacatalog.v1.Taxonomy.PolicyType\"\xa6\x01\n\x13SerializedPolicyTag\x12\x12\n\npolicy_tag\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12K\n\x11\x63hild_policy_tags\x18\x04 \x03(\x0b\x32\x30.google.cloud.datacatalog.v1.SerializedPolicyTag\"\xa6\x01\n\x16ReplaceTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\x12Q\n\x13serialized_taxonomy\x18\x02 \x01(\x0b\x32/.google.cloud.datacatalog.v1.SerializedTaxonomyB\x03\xe0\x41\x02\"\xf7\x01\n\x17ImportTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12\x42\n\rinline_source\x18\x02 \x01(\x0b\x32).google.cloud.datacatalog.v1.InlineSourceH\x00\x12Q\n\x15\x63ross_regional_source\x18\x03 \x01(\x0b\x32\x30.google.cloud.datacatalog.v1.CrossRegionalSourceH\x00\x42\x08\n\x06source\"X\n\x0cInlineSource\x12H\n\ntaxonomies\x18\x01 \x03(\x0b\x32/.google.cloud.datacatalog.v1.SerializedTaxonomyB\x03\xe0\x41\x02\"T\n\x13\x43rossRegionalSource\x12=\n\x08taxonomy\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\"U\n\x18ImportTaxonomiesResponse\x12\x39\n\ntaxonomies\x18\x01 \x03(\x0b\x32%.google.cloud.datacatalog.v1.Taxonomy\"\xc7\x01\n\x17\x45xportTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12?\n\ntaxonomies\x18\x02 \x03(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\x12\x1f\n\x15serialized_taxonomies\x18\x03 \x01(\x08H\x00\x42\r\n\x0b\x64\x65stination\"_\n\x18\x45xportTaxonomiesResponse\x12\x43\n\ntaxonomies\x18\x01 \x03(\x0b\x32/.google.cloud.datacatalog.v1.SerializedTaxonomy2\xa7\x05\n\x1dPolicyTagManagerSerialization\x12\xb0\x01\n\x0fReplaceTaxonomy\x12\x33.google.cloud.datacatalog.v1.ReplaceTaxonomyRequest\x1a%.google.cloud.datacatalog.v1.Taxonomy\"A\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/taxonomies/*}:replace:\x01*\x12\xc1\x01\n\x10ImportTaxonomies\x12\x34.google.cloud.datacatalog.v1.ImportTaxonomiesRequest\x1a\x35.google.cloud.datacatalog.v1.ImportTaxonomiesResponse\"@\x82\xd3\xe4\x93\x02:\"5/v1/{parent=projects/*/locations/*}/taxonomies:import:\x01*\x12\xbe\x01\n\x10\x45xportTaxonomies\x12\x34.google.cloud.datacatalog.v1.ExportTaxonomiesRequest\x1a\x35.google.cloud.datacatalog.v1.ExportTaxonomiesResponse\"=\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/taxonomies:export\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xe7\x01\n\x1f\x63om.google.cloud.datacatalog.v1B\"PolicyTagManagerSerializationProtoP\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.datacatalog.v1.Taxonomy", "google/cloud/datacatalog/v1/policytagmanager.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 DataCatalog + module V1 + SerializedTaxonomy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SerializedTaxonomy").msgclass + SerializedPolicyTag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SerializedPolicyTag").msgclass + ReplaceTaxonomyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ReplaceTaxonomyRequest").msgclass + ImportTaxonomiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ImportTaxonomiesRequest").msgclass + InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.InlineSource").msgclass + CrossRegionalSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CrossRegionalSource").msgclass + ImportTaxonomiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ImportTaxonomiesResponse").msgclass + ExportTaxonomiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ExportTaxonomiesRequest").msgclass + ExportTaxonomiesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ExportTaxonomiesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_services_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_services_pb.rb new file mode 100644 index 000000000000..2b031d858dc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/policytagmanagerserialization_services_pb.rb @@ -0,0 +1,76 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/datacatalog/v1/policytagmanagerserialization.proto for package 'Google.Cloud.DataCatalog.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/datacatalog/v1/policytagmanagerserialization_pb' + +module Google + module Cloud + module DataCatalog + module V1 + module PolicyTagManagerSerialization + # Policy Tag Manager Serialization API service allows you to manipulate + # your policy tags and taxonomies in a serialized format. + # + # Taxonomy is a hierarchical group of policy tags. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.datacatalog.v1.PolicyTagManagerSerialization' + + # Replaces (updates) a taxonomy and all its policy tags. + # + # The taxonomy and its entire hierarchy of policy tags must be + # represented literally by `SerializedTaxonomy` and the nested + # `SerializedPolicyTag` messages. + # + # This operation automatically does the following: + # + # - Deletes the existing policy tags that are missing from the + # `SerializedPolicyTag`. + # - Creates policy tags that don't have resource names. They are considered + # new. + # - Updates policy tags with valid resources names accordingly. + rpc :ReplaceTaxonomy, ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest, ::Google::Cloud::DataCatalog::V1::Taxonomy + # Creates new taxonomies (including their policy tags) in a given project + # by importing from inlined or cross-regional sources. + # + # For a cross-regional source, new taxonomies are created by copying + # from a source in another region. + # + # For an inlined source, taxonomies and policy tags are created in bulk using + # nested protocol buffer structures. + rpc :ImportTaxonomies, ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest, ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse + # Exports taxonomies in the requested type and returns them, + # including their policy tags. The requested taxonomies must belong to the + # same project. + # + # This method generates `SerializedTaxonomy` protocol buffers with nested + # policy tags that can be used as input for `ImportTaxonomies` calls. + rpc :ExportTaxonomies, ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest, ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/schema_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/schema_pb.rb new file mode 100644 index 000000000000..da0752d3cb6c --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/schema_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/schema.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n(google/cloud/datacatalog/v1/schema.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\"D\n\x06Schema\x12:\n\x07\x63olumns\x18\x02 \x03(\x0b\x32).google.cloud.datacatalog.v1.ColumnSchema\"\xd5\x07\n\x0c\x43olumnSchema\x12\x13\n\x06\x63olumn\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04mode\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rdefault_value\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10ordinal_position\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x12Z\n\x15highest_indexing_type\x18\n \x01(\x0e\x32\x36.google.cloud.datacatalog.v1.ColumnSchema.IndexingTypeB\x03\xe0\x41\x01\x12\x42\n\nsubcolumns\x18\x07 \x03(\x0b\x32).google.cloud.datacatalog.v1.ColumnSchemaB\x03\xe0\x41\x01\x12X\n\x12looker_column_spec\x18\x12 \x01(\x0b\x32:.google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpecH\x00\x12[\n\x12range_element_type\x18\x13 \x01(\x0b\x32:.google.cloud.datacatalog.v1.ColumnSchema.FieldElementTypeB\x03\xe0\x41\x01\x12\x14\n\x07gc_rule\x18\x0b \x01(\tB\x03\xe0\x41\x01\x1a\xf2\x01\n\x10LookerColumnSpec\x12Y\n\x04type\x18\x01 \x01(\x0e\x32K.google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType\"\x82\x01\n\x10LookerColumnType\x12\"\n\x1eLOOKER_COLUMN_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tDIMENSION\x10\x01\x12\x13\n\x0f\x44IMENSION_GROUP\x10\x02\x12\n\n\x06\x46ILTER\x10\x03\x12\x0b\n\x07MEASURE\x10\x04\x12\r\n\tPARAMETER\x10\x05\x1a%\n\x10\x46ieldElementType\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x9c\x01\n\x0cIndexingType\x12\x1d\n\x19INDEXING_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12INDEXING_TYPE_NONE\x10\x01\x12\x1c\n\x18INDEXING_TYPE_NON_UNIQUE\x10\x02\x12\x18\n\x14INDEXING_TYPE_UNIQUE\x10\x03\x12\x1d\n\x19INDEXING_TYPE_PRIMARY_KEY\x10\x04\x42\r\n\x0bsystem_specB\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + 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 DataCatalog + module V1 + Schema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Schema").msgclass + ColumnSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ColumnSchema").msgclass + ColumnSchema::LookerColumnSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec").msgclass + ColumnSchema::LookerColumnSpec::LookerColumnType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType").enummodule + ColumnSchema::FieldElementType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ColumnSchema.FieldElementType").msgclass + ColumnSchema::IndexingType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ColumnSchema.IndexingType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/search_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/search_pb.rb new file mode 100644 index 000000000000..02a0e4c1c6e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/search_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/search.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/datacatalog/v1/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/datacatalog/v1/search.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/datacatalog/v1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xae\x03\n\x13SearchCatalogResult\x12I\n\x12search_result_type\x18\x01 \x01(\x0e\x32-.google.cloud.datacatalog.v1.SearchResultType\x12\x1d\n\x15search_result_subtype\x18\x02 \x01(\t\x12\x1e\n\x16relative_resource_name\x18\x03 \x01(\t\x12\x17\n\x0flinked_resource\x18\x04 \x01(\t\x12/\n\x0bmodify_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12O\n\x11integrated_system\x18\x08 \x01(\x0e\x32-.google.cloud.datacatalog.v1.IntegratedSystemB\x03\xe0\x41\x03H\x00\x12\x1f\n\x15user_specified_system\x18\t \x01(\tH\x00\x12\x1c\n\x14\x66ully_qualified_name\x18\n \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0c \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\r \x01(\tB\x08\n\x06system*d\n\x10SearchResultType\x12\"\n\x1eSEARCH_RESULT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45NTRY\x10\x01\x12\x10\n\x0cTAG_TEMPLATE\x10\x02\x12\x0f\n\x0b\x45NTRY_GROUP\x10\x03\x42\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DataCatalog + module V1 + SearchCatalogResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SearchCatalogResult").msgclass + SearchResultType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SearchResultType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/table_spec_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/table_spec_pb.rb new file mode 100644 index 000000000000..deac6957aa56 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/table_spec_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/table_spec.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n,google/cloud/datacatalog/v1/table_spec.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xe8\x01\n\x11\x42igQueryTableSpec\x12L\n\x11table_source_type\x18\x01 \x01(\x0e\x32,.google.cloud.datacatalog.v1.TableSourceTypeB\x03\xe0\x41\x03\x12:\n\tview_spec\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1.ViewSpecH\x00\x12<\n\ntable_spec\x18\x03 \x01(\x0b\x32&.google.cloud.datacatalog.v1.TableSpecH\x00\x42\x0b\n\ttype_spec\"#\n\x08ViewSpec\x12\x17\n\nview_query\x18\x01 \x01(\tB\x03\xe0\x41\x03\"L\n\tTableSpec\x12?\n\rgrouped_entry\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41\"\n datacatalog.googleapis.com/Entry\"\xad\x01\n\x17\x42igQueryDateShardedSpec\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41\"\n datacatalog.googleapis.com/Entry\x12\x19\n\x0ctable_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\"\n\x15latest_shard_resource\x18\x04 \x01(\tB\x03\xe0\x41\x03*{\n\x0fTableSourceType\x12!\n\x1dTABLE_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rBIGQUERY_VIEW\x10\x02\x12\x12\n\x0e\x42IGQUERY_TABLE\x10\x05\x12\x1e\n\x1a\x42IGQUERY_MATERIALIZED_VIEW\x10\x07\x42\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + 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 DataCatalog + module V1 + BigQueryTableSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.BigQueryTableSpec").msgclass + ViewSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.ViewSpec").msgclass + TableSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TableSpec").msgclass + BigQueryDateShardedSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.BigQueryDateShardedSpec").msgclass + TableSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TableSourceType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/tags_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/tags_pb.rb new file mode 100644 index 000000000000..e4ab132acc73 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/tags_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/tags.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/datacatalog/v1/tags.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf3\x03\n\x03Tag\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x15\n\x08template\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15template_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x06\x63olumn\x18\x04 \x01(\tH\x00\x12\x41\n\x06\x66ields\x18\x03 \x03(\x0b\x32,.google.cloud.datacatalog.v1.Tag.FieldsEntryB\x03\xe0\x41\x02\x12\x66\n\x18\x64\x61taplex_transfer_status\x18\x07 \x01(\x0e\x32?.google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatusB\x03\xe0\x41\x03\x1aT\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1.TagField:\x02\x38\x01:\x81\x01\xea\x41~\n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\\projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}B\x07\n\x05scope\"\xc2\x02\n\x08TagField\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12\x35\n\x0ftimestamp_value\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x45\n\nenum_value\x18\x06 \x01(\x0b\x32/.google.cloud.datacatalog.v1.TagField.EnumValueH\x00\x12\x18\n\x0erichtext_value\x18\x08 \x01(\tH\x00\x12\x12\n\x05order\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x1a!\n\tEnumValue\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x06\n\x04kind\"\xbe\x04\n\x0bTagTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14is_publicly_readable\x18\x05 \x01(\x08\x12I\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x34.google.cloud.datacatalog.v1.TagTemplate.FieldsEntryB\x03\xe0\x41\x02\x12\x66\n\x18\x64\x61taplex_transfer_status\x18\x07 \x01(\x0e\x32?.google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatusB\x03\xe0\x41\x01\x1a\\\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1.TagTemplateField:\x02\x38\x01\"e\n\x16\x44\x61taplexTransferStatus\x12(\n$DATAPLEX_TRANSFER_STATUS_UNSPECIFIED\x10\x00\x12\x10\n\x08MIGRATED\x10\x01\x1a\x02\x08\x01\x12\x0f\n\x0bTRANSFERRED\x10\x02:p\xea\x41m\n&datacatalog.googleapis.com/TagTemplate\x12\x43projects/{project}/locations/{location}/tagTemplates/{tag_template}\"\xb7\x02\n\x10TagTemplateField\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x39\n\x04type\x18\x02 \x01(\x0b\x32&.google.cloud.datacatalog.v1.FieldTypeB\x03\xe0\x41\x02\x12\x13\n\x0bis_required\x18\x03 \x01(\x08\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\r\n\x05order\x18\x05 \x01(\x05:\x85\x01\xea\x41\x81\x01\n+datacatalog.googleapis.com/TagTemplateField\x12Rprojects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}\"\xa6\x03\n\tFieldType\x12N\n\x0eprimitive_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.datacatalog.v1.FieldType.PrimitiveTypeH\x00\x12\x44\n\tenum_type\x18\x02 \x01(\x0b\x32/.google.cloud.datacatalog.v1.FieldType.EnumTypeH\x00\x1a\x85\x01\n\x08\x45numType\x12Q\n\x0e\x61llowed_values\x18\x01 \x03(\x0b\x32\x39.google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue\x1a&\n\tEnumValue\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"n\n\rPrimitiveType\x12\x1e\n\x1aPRIMITIVE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\n\n\x06STRING\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\r\n\tTIMESTAMP\x10\x04\x12\x0c\n\x08RICHTEXT\x10\x05\x42\x0b\n\ttype_declB\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DataCatalog + module V1 + Tag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.Tag").msgclass + TagField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TagField").msgclass + TagField::EnumValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TagField.EnumValue").msgclass + TagTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TagTemplate").msgclass + TagTemplate::DataplexTransferStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatus").enummodule + TagTemplateField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.TagTemplateField").msgclass + FieldType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FieldType").msgclass + FieldType::EnumType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FieldType.EnumType").msgclass + FieldType::EnumType::EnumValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue").msgclass + FieldType::PrimitiveType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.FieldType.PrimitiveType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/timestamps_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/timestamps_pb.rb new file mode 100644 index 000000000000..678ca9d377b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/timestamps_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/timestamps.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/datacatalog/v1/timestamps.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xaa\x01\n\x10SystemTimestamps\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DataCatalog + module V1 + SystemTimestamps = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.SystemTimestamps").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb new file mode 100644 index 000000000000..2dc02969ad9b --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog/v1/usage.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\'google/cloud/datacatalog/v1/usage.proto\x12\x1bgoogle.cloud.datacatalog.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x01\n\nUsageStats\x12\x19\n\x11total_completions\x18\x01 \x01(\x02\x12\x16\n\x0etotal_failures\x18\x02 \x01(\x02\x12\x1b\n\x13total_cancellations\x18\x03 \x01(\x02\x12\x33\n+total_execution_time_for_completions_millis\x18\x04 \x01(\x02\":\n\x10\x43ommonUsageStats\x12\x17\n\nview_count\x18\x01 \x01(\x03H\x00\x88\x01\x01\x42\r\n\x0b_view_count\"\xa2\x04\n\x0bUsageSignal\x12/\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12h\n\x17usage_within_time_range\x18\x02 \x03(\x0b\x32\x42.google.cloud.datacatalog.v1.UsageSignal.UsageWithinTimeRangeEntryB\x03\xe0\x41\x03\x12p\n\x1e\x63ommon_usage_within_time_range\x18\x03 \x03(\x0b\x32H.google.cloud.datacatalog.v1.UsageSignal.CommonUsageWithinTimeRangeEntry\x12\x1b\n\x0e\x66\x61vorite_count\x18\x04 \x01(\x03H\x00\x88\x01\x01\x1a\x64\n\x19UsageWithinTimeRangeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.datacatalog.v1.UsageStats:\x02\x38\x01\x1ap\n\x1f\x43ommonUsageWithinTimeRangeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1.CommonUsageStats:\x02\x38\x01\x42\x11\n\x0f_favorite_countB\xc3\x01\n\x1f\x63om.google.cloud.datacatalog.v1P\x01ZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb\xaa\x02\x1bGoogle.Cloud.DataCatalog.V1\xca\x02\x1bGoogle\\Cloud\\DataCatalog\\V1\xea\x02\x1eGoogle::Cloud::DataCatalog::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DataCatalog + module V1 + UsageStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UsageStats").msgclass + CommonUsageStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.CommonUsageStats").msgclass + UsageSignal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.datacatalog.v1.UsageSignal").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/README.md new file mode 100644 index 000000000000..d89d7e1e7c61 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Data Catalog 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-data_catalog-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d91b62e77002 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/client.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..935946d52792 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/bigquery.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/bigquery.rb new file mode 100644 index 000000000000..17497aa79abc --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/bigquery.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Specification for the BigQuery connection. + # @!attribute [rw] connection_type + # @return [::Google::Cloud::DataCatalog::V1::BigQueryConnectionSpec::ConnectionType] + # The type of the BigQuery connection. + # @!attribute [rw] cloud_sql + # @return [::Google::Cloud::DataCatalog::V1::CloudSqlBigQueryConnectionSpec] + # Specification for the BigQuery connection to a Cloud SQL instance. + # @!attribute [rw] has_credential + # @return [::Boolean] + # True if there are credentials attached to the BigQuery connection; false + # otherwise. + class BigQueryConnectionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the BigQuery connection. + module ConnectionType + # Unspecified type. + CONNECTION_TYPE_UNSPECIFIED = 0 + + # Cloud SQL connection. + CLOUD_SQL = 1 + end + end + + # Specification for the BigQuery connection to a Cloud SQL instance. + # @!attribute [rw] instance_id + # @return [::String] + # Cloud SQL instance ID in the format of `project:location:instance`. + # @!attribute [rw] database + # @return [::String] + # Database name. + # @!attribute [rw] type + # @return [::Google::Cloud::DataCatalog::V1::CloudSqlBigQueryConnectionSpec::DatabaseType] + # Type of the Cloud SQL database. + class CloudSqlBigQueryConnectionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Supported Cloud SQL database types. + module DatabaseType + # Unspecified database type. + DATABASE_TYPE_UNSPECIFIED = 0 + + # Cloud SQL for PostgreSQL. + POSTGRES = 1 + + # Cloud SQL for MySQL. + MYSQL = 2 + end + end + + # Fields specific for BigQuery routines. + # @!attribute [rw] imported_libraries + # @return [::Array<::String>] + # Paths of the imported libraries. + class BigQueryRoutineSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/common.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/common.rb new file mode 100644 index 000000000000..62c15333d9b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/common.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Entry metadata relevant only to the user and private to them. + # @!attribute [rw] starred + # @return [::Boolean] + # True if the entry is starred by the user; false otherwise. + # @!attribute [rw] star_time + # @return [::Google::Protobuf::Timestamp] + # Set if the entry is starred; unset otherwise. + class PersonalDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This enum lists all the systems that Data Catalog integrates with. + module IntegratedSystem + # Default unknown system. + INTEGRATED_SYSTEM_UNSPECIFIED = 0 + + # BigQuery. + BIGQUERY = 1 + + # Cloud Pub/Sub. + CLOUD_PUBSUB = 2 + + # Dataproc Metastore. + DATAPROC_METASTORE = 3 + + # Dataplex. + DATAPLEX = 4 + + # Cloud Spanner + CLOUD_SPANNER = 6 + + # Cloud Bigtable + CLOUD_BIGTABLE = 7 + + # Cloud Sql + CLOUD_SQL = 8 + + # Looker + LOOKER = 9 + + # Vertex AI + VERTEX_AI = 10 + end + + # This enum describes all the systems that manage + # Taxonomy and PolicyTag resources in DataCatalog. + module ManagingSystem + # Default value + MANAGING_SYSTEM_UNSPECIFIED = 0 + + # Dataplex. + MANAGING_SYSTEM_DATAPLEX = 1 + + # Other + MANAGING_SYSTEM_OTHER = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/data_source.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/data_source.rb new file mode 100644 index 000000000000..beca4d341d87 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/data_source.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Physical location of an entry. + # @!attribute [rw] service + # @return [::Google::Cloud::DataCatalog::V1::DataSource::Service] + # Service that physically stores the data. + # @!attribute [rw] resource + # @return [::String] + # Full name of a resource as defined by the service. For example: + # + # `//bigquery.googleapis.com/projects/{PROJECT_ID}/locations/{LOCATION}/datasets/{DATASET_ID}/tables/{TABLE_ID}` + # @!attribute [r] source_entry + # @return [::String] + # Output only. Data Catalog entry name, if applicable. + # @!attribute [rw] storage_properties + # @return [::Google::Cloud::DataCatalog::V1::StorageProperties] + # Detailed properties of the underlying storage. + class DataSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Name of a service that stores the data. + module Service + # Default unknown service. + SERVICE_UNSPECIFIED = 0 + + # Google Cloud Storage service. + CLOUD_STORAGE = 1 + + # BigQuery service. + BIGQUERY = 2 + end + end + + # Details the properties of the underlying storage. + # @!attribute [rw] file_pattern + # @return [::Array<::String>] + # Patterns to identify a set of files for this fileset. + # + # Examples of a valid `file_pattern`: + # + # * `gs://bucket_name/dir/*`: matches all files in the `bucket_name/dir` + # directory + # * `gs://bucket_name/dir/**`: matches all files in the `bucket_name/dir` + # and all subdirectories recursively + # * `gs://bucket_name/file*`: matches files prefixed by `file` in + # `bucket_name` + # * `gs://bucket_name/??.txt`: matches files with two characters followed by + # `.txt` in `bucket_name` + # * `gs://bucket_name/[aeiou].txt`: matches files that contain a single + # vowel character followed by `.txt` in + # `bucket_name` + # * `gs://bucket_name/[a-m].txt`: matches files that contain `a`, `b`, ... + # or `m` followed by `.txt` in `bucket_name` + # * `gs://bucket_name/a/*/b`: matches all files in `bucket_name` that match + # the `a/*/b` pattern, such as `a/c/b`, `a/d/b` + # * `gs://another_bucket/a.txt`: matches `gs://another_bucket/a.txt` + # @!attribute [rw] file_type + # @return [::String] + # File type in MIME format, for example, `text/plain`. + class StorageProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb new file mode 100644 index 000000000000..c7b3c7787cc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb @@ -0,0 +1,1806 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalog}. + # @!attribute [rw] scope + # @return [::Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope] + # Required. The scope of this search request. + # + # The `scope` is invalid if `include_org_ids`, `include_project_ids` are + # empty AND `include_gcp_public_datasets` is set to `false`. In this case, + # the request returns an error. + # @!attribute [rw] query + # @return [::String] + # Optional. The query string with a minimum of 3 characters and specific + # syntax. For more information, see [Data Catalog search + # syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference). + # + # An empty query string returns all data assets (in the specified scope) + # that you have access to. + # + # A query string can be a simple `xyz` or qualified by predicates: + # + # * `name:x` + # * `column:y` + # * `description:z` + # @!attribute [rw] page_size + # @return [::Integer] + # Upper bound on the number of results you can get in a single response. + # + # Can't be negative or 0, defaults to 10 in this case. + # The maximum number is 1000. If exceeded, throws an "invalid argument" + # exception. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token that, if specified, returns the next page of + # search results. If empty, returns the first page. + # + # This token is returned in the + # {::Google::Cloud::DataCatalog::V1::SearchCatalogResponse#next_page_token SearchCatalogResponse.next_page_token} + # field of the response to a previous + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalogRequest} + # call. + # @!attribute [rw] order_by + # @return [::String] + # Specifies the order of results. + # + # Currently supported case-sensitive values are: + # + # * `relevance` that can only be descending + # * `last_modified_timestamp [asc|desc]` with descending (`desc`) as default + # * `default` that can only be descending + # + # Search queries don't guarantee full recall. Results that match your query + # might not be returned, even in subsequent result pages. Additionally, + # returned (and not returned) results can vary if you repeat search queries. + # If you are experiencing recall issues and you don't have to fetch the + # results in any specific order, consider setting this parameter to + # `default`. + # + # If this parameter is omitted, it defaults to the descending `relevance`. + # @!attribute [rw] admin_search + # @return [::Boolean] + # Optional. If set, use searchAll permission granted on organizations from + # `include_org_ids` and projects from `include_project_ids` instead of the + # fine grained per resource permissions when filtering the search results. + # The only allowed `order_by` criteria for admin_search mode is `default`. + # Using this flags guarantees a full recall of the search results. + class SearchCatalogRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The criteria that select the subspace used for query matching. + # @!attribute [rw] include_org_ids + # @return [::Array<::String>] + # The list of organization IDs to search within. + # + # To find your organization ID, follow the steps from + # [Creating and managing organizations] + # (/resource-manager/docs/creating-managing-organization). + # @!attribute [rw] include_project_ids + # @return [::Array<::String>] + # The list of project IDs to search within. + # + # For more information on the distinction between project names, IDs, and + # numbers, see [Projects](/docs/overview/#projects). + # @!attribute [rw] include_gcp_public_datasets + # @return [::Boolean] + # If `true`, include Google Cloud public datasets in + # search results. By default, they are excluded. + # + # See [Google Cloud Public Datasets](/public-datasets) for more + # information. + # @!attribute [rw] restricted_locations + # @return [::Array<::String>] + # Optional. The list of locations to search within. If empty, all locations + # are searched. + # + # Returns an error if any location in the list isn't one of the [Supported + # regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions). + # + # If a location is unreachable, its name is returned in the + # `SearchCatalogResponse.unreachable` field. To get additional information + # on the error, repeat the search request and set the location name as the + # value of this parameter. + # @!attribute [rw] starred_only + # @return [::Boolean] + # Optional. If `true`, search only among starred entries. + # + # By default, all results are returned, starred or not. + # @!attribute [rw] include_public_tag_templates + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. This field is deprecated. The search mechanism for public and + # private tag templates is the same. + class Scope + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog SearchCatalog}. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::DataCatalog::V1::SearchCatalogResult>] + # Search results. + # @!attribute [rw] total_size + # @return [::Integer] + # The approximate total number of entries matched by the query. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token that can be used in subsequent calls to retrieve the next + # page of results. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable locations. Search results don't include data from those + # locations. + # + # To get additional information on an error, repeat the search request and + # restrict it to specific locations by setting the + # `SearchCatalogRequest.scope.restricted_locations` parameter. + class SearchCatalogResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry_group CreateEntryGroup}. + # @!attribute [rw] parent + # @return [::String] + # Required. The names of the project and location that the new entry group + # belongs to. + # + # Note: The entry group itself and its child resources might not be + # stored in the location specified in its name. + # @!attribute [rw] entry_group_id + # @return [::String] + # Required. The ID of the entry group to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and must start with a letter or underscore. + # The maximum size is 64 bytes when encoded in UTF-8. + # @!attribute [rw] entry_group + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # The entry group to create. Defaults to empty. + class CreateEntryGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry_group UpdateEntryGroup}. + # @!attribute [rw] entry_group + # @return [::Google::Cloud::DataCatalog::V1::EntryGroup] + # Required. Updates for the entry group. The `name` field must be set. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Names of fields whose values to overwrite on an entry group. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + class UpdateEntryGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry_group GetEntryGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entry group to get. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # The fields to return. If empty or omitted, all fields are returned. + class GetEntryGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry_group DeleteEntryGroup}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entry group to delete. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If true, deletes all entries in the entry group. + class DeleteEntryGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entry_groups ListEntryGroups}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the location that contains the entry groups to list. + # + # Can be provided as a URL. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # Default is 10. Maximum limit is 1000. + # Throws an invalid argument if `page_size` is greater than 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token that specifies the next page to return. + # If empty, returns the first page. + class ListEntryGroupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entry_groups ListEntryGroups}. + # @!attribute [rw] entry_groups + # @return [::Array<::Google::Cloud::DataCatalog::V1::EntryGroup>] + # Entry group details. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token to specify in the next call to retrieve the next page of + # results. Empty if there are no more items. + class ListEntryGroupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry CreateEntry}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the entry group this entry belongs to. + # + # Note: The entry itself and its child resources might not be stored in + # the location specified in its name. + # @!attribute [rw] entry_id + # @return [::String] + # Required. The ID of the entry to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # and underscores (_). + # The maximum size is 64 bytes when encoded in UTF-8. + # @!attribute [rw] entry + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # Required. The entry to create. + class CreateEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry UpdateEntry}. + # @!attribute [rw] entry + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # Required. Updates for the entry. The `name` field must be set. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Names of fields whose values to overwrite on an entry. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # You can modify only the fields listed below. + # + # For entries with type `DATA_STREAM`: + # + # * `schema` + # + # For entries with type `FILESET`: + # + # * `schema` + # * `display_name` + # * `description` + # * `gcs_fileset_spec` + # * `gcs_fileset_spec.file_patterns` + # + # For entries with `user_specified_type`: + # + # * `schema` + # * `display_name` + # * `description` + # * `user_specified_type` + # * `user_specified_system` + # * `linked_resource` + # * `source_system_timestamps` + class UpdateEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry DeleteEntry}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entry to delete. + class DeleteEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry GetEntry}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entry to get. + class GetEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#lookup_entry LookupEntry}. + # @!attribute [rw] linked_resource + # @return [::String] + # The full name of the Google Cloud Platform resource the Data Catalog + # entry represents. For more information, see [Full Resource Name] + # (https://cloud.google.com/apis/design/resource_names#full_resource_name). + # + # Full names are case-sensitive. For example: + # + # * `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}` + # * `//pubsub.googleapis.com/projects/{PROJECT_ID}/topics/{TOPIC_ID}` + # @!attribute [rw] sql_resource + # @return [::String] + # The SQL name of the entry. SQL names are case-sensitive. + # + # Examples: + # + # * `pubsub.topic.{PROJECT_ID}.{TOPIC_ID}` + # * `pubsub.topic.{PROJECT_ID}.`\``{TOPIC.ID.SEPARATED.WITH.DOTS}`\` + # * `bigquery.table.{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}` + # * `bigquery.dataset.{PROJECT_ID}.{DATASET_ID}` + # * `datacatalog.entry.{PROJECT_ID}.{LOCATION_ID}.{ENTRY_GROUP_ID}.{ENTRY_ID}` + # + # Identifiers (`*_ID`) should comply with the + # [Lexical structure in Standard SQL] + # (https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical). + # @!attribute [rw] fully_qualified_name + # @return [::String] + # [Fully Qualified Name + # (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + # of the resource. + # + # FQNs take two forms: + # + # * For non-regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # * For regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # Example for a DPMS table: + # + # `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}` + # @!attribute [rw] project + # @return [::String] + # Project where the lookup should be performed. Required to lookup + # entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + # using its `fully_qualified_name`. Ignored in other cases. + # @!attribute [rw] location + # @return [::String] + # Location where the lookup should be performed. Required to lookup + # entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system` + # using its `fully_qualified_name`. Ignored in other cases. + class LookupEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Entry metadata. + # A Data Catalog entry represents another resource in Google + # Cloud Platform (such as a BigQuery dataset or a Pub/Sub topic) or + # outside of it. You can use the `linked_resource` field + # in the entry resource to refer to the original resource ID of the source + # system. + # + # An entry resource contains resource details, for example, its schema. + # Additionally, you can attach flexible metadata to an entry in the form of a + # {::Google::Cloud::DataCatalog::V1::Tag Tag}. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of an entry in URL format. + # + # Note: The entry itself and its child resources might not be + # stored in the location specified in its name. + # @!attribute [rw] linked_resource + # @return [::String] + # The resource this metadata entry refers to. + # + # For Google Cloud Platform resources, `linked_resource` is the + # [Full Resource Name] + # (https://cloud.google.com/apis/design/resource_names#full_resource_name). + # For example, the `linked_resource` for a table resource from BigQuery is: + # + # `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}` + # + # Output only when the entry is one of the types in the `EntryType` enum. + # + # For entries with a `user_specified_type`, this field is optional and + # defaults to an empty string. + # + # The resource string must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), periods (.), colons (:), slashes (/), dashes (-), + # and hashes (#). + # The maximum size is 200 bytes when encoded in UTF-8. + # @!attribute [rw] fully_qualified_name + # @return [::String] + # [Fully Qualified Name + # (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names) + # of the resource. Set automatically for entries representing resources from + # synced systems. Settable only during creation, and read-only later. Can + # be used for search and lookup of the entries. + # @!attribute [rw] type + # @return [::Google::Cloud::DataCatalog::V1::EntryType] + # The type of the entry. + # + # For details, see [`EntryType`](#entrytype). + # @!attribute [rw] user_specified_type + # @return [::String] + # Custom entry type that doesn't match any of the values allowed for input + # and listed in the `EntryType` enum. + # + # When creating an entry, first check the type values in the enum. + # If there are no appropriate types for the new entry, + # provide a custom value, for example, `my_special_type`. + # + # The `user_specified_type` string has the following limitations: + # + # * Is case insensitive. + # * Must begin with a letter or underscore. + # * Can only contain letters, numbers, and underscores. + # * Must be at least 1 character and at most 64 characters long. + # @!attribute [r] integrated_system + # @return [::Google::Cloud::DataCatalog::V1::IntegratedSystem] + # Output only. Indicates the entry's source system that Data Catalog + # integrates with, such as BigQuery, Pub/Sub, or Dataproc Metastore. + # @!attribute [rw] user_specified_system + # @return [::String] + # Indicates the entry's source system that Data Catalog doesn't + # automatically integrate with. + # + # The `user_specified_system` string has the following limitations: + # + # * Is case insensitive. + # * Must begin with a letter or underscore. + # * Can only contain letters, numbers, and underscores. + # * Must be at least 1 character and at most 64 characters long. + # @!attribute [rw] sql_database_system_spec + # @return [::Google::Cloud::DataCatalog::V1::SqlDatabaseSystemSpec] + # Specification that applies to a relational database system. Only settable + # when `user_specified_system` is equal to `SQL_DATABASE` + # @!attribute [rw] looker_system_spec + # @return [::Google::Cloud::DataCatalog::V1::LookerSystemSpec] + # Specification that applies to Looker sysstem. Only settable when + # `user_specified_system` is equal to `LOOKER` + # @!attribute [rw] cloud_bigtable_system_spec + # @return [::Google::Cloud::DataCatalog::V1::CloudBigtableSystemSpec] + # Specification that applies to Cloud Bigtable system. Only settable when + # `integrated_system` is equal to `CLOUD_BIGTABLE` + # @!attribute [rw] gcs_fileset_spec + # @return [::Google::Cloud::DataCatalog::V1::GcsFilesetSpec] + # Specification that applies to a Cloud Storage fileset. Valid only + # for entries with the `FILESET` type. + # @!attribute [r] bigquery_table_spec + # @return [::Google::Cloud::DataCatalog::V1::BigQueryTableSpec] + # Output only. Specification that applies to a BigQuery table. Valid only + # for entries with the `TABLE` type. + # @!attribute [r] bigquery_date_sharded_spec + # @return [::Google::Cloud::DataCatalog::V1::BigQueryDateShardedSpec] + # Output only. Specification for a group of BigQuery tables with + # the `[prefix]YYYYMMDD` name pattern. + # + # For more information, see [Introduction to partitioned tables] + # (https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding). + # @!attribute [rw] database_table_spec + # @return [::Google::Cloud::DataCatalog::V1::DatabaseTableSpec] + # Specification that applies to a table resource. Valid only + # for entries with the `TABLE` or `EXPLORE` type. + # @!attribute [rw] data_source_connection_spec + # @return [::Google::Cloud::DataCatalog::V1::DataSourceConnectionSpec] + # Specification that applies to a data source connection. Valid only + # for entries with the `DATA_SOURCE_CONNECTION` type. + # @!attribute [rw] routine_spec + # @return [::Google::Cloud::DataCatalog::V1::RoutineSpec] + # Specification that applies to a user-defined function or procedure. Valid + # only for entries with the `ROUTINE` type. + # @!attribute [rw] dataset_spec + # @return [::Google::Cloud::DataCatalog::V1::DatasetSpec] + # Specification that applies to a dataset. + # @!attribute [rw] fileset_spec + # @return [::Google::Cloud::DataCatalog::V1::FilesetSpec] + # Specification that applies to a fileset resource. Valid only + # for entries with the `FILESET` type. + # @!attribute [rw] service_spec + # @return [::Google::Cloud::DataCatalog::V1::ServiceSpec] + # Specification that applies to a Service resource. + # @!attribute [rw] model_spec + # @return [::Google::Cloud::DataCatalog::V1::ModelSpec] + # Model specification. + # @!attribute [rw] feature_online_store_spec + # @return [::Google::Cloud::DataCatalog::V1::FeatureOnlineStoreSpec] + # FeatureonlineStore spec for Vertex AI Feature Store. + # @!attribute [rw] display_name + # @return [::String] + # Display name of an entry. + # + # The maximum size is 500 bytes when encoded in UTF-8. + # Default value is an empty string. + # @!attribute [rw] description + # @return [::String] + # Entry description that can consist of several sentences or paragraphs + # that describe entry contents. + # + # The description must not contain Unicode non-characters as well as C0 + # and C1 control codes except tabs (HT), new lines (LF), carriage returns + # (CR), and page breaks (FF). + # The maximum size is 2000 bytes when encoded in UTF-8. + # Default value is an empty string. + # @!attribute [rw] business_context + # @return [::Google::Cloud::DataCatalog::V1::BusinessContext] + # Business Context of the entry. Not supported for BigQuery datasets + # @!attribute [rw] schema + # @return [::Google::Cloud::DataCatalog::V1::Schema] + # Schema of the entry. An entry might not have any schema attached to it. + # @!attribute [rw] source_system_timestamps + # @return [::Google::Cloud::DataCatalog::V1::SystemTimestamps] + # Timestamps from the underlying resource, not from the Data Catalog + # entry. + # + # Output only when the entry has a system listed in the `IntegratedSystem` + # enum. For entries with `user_specified_system`, this field is optional + # and defaults to an empty timestamp. + # @!attribute [rw] usage_signal + # @return [::Google::Cloud::DataCatalog::V1::UsageSignal] + # Resource usage statistics. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Cloud labels attached to the entry. + # + # In Data Catalog, you can create and modify labels attached only to custom + # entries. Synced entries have unmodifiable labels that come from the source + # system. + # @!attribute [r] data_source + # @return [::Google::Cloud::DataCatalog::V1::DataSource] + # Output only. Physical location of the entry. + # @!attribute [r] personal_details + # @return [::Google::Cloud::DataCatalog::V1::PersonalDetails] + # Output only. Additional information related to the entry. Private to the + # current user. + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specification that applies to a table resource. Valid only + # for entries with the `TABLE` type. + # @!attribute [rw] type + # @return [::Google::Cloud::DataCatalog::V1::DatabaseTableSpec::TableType] + # Type of this table. + # @!attribute [r] dataplex_table + # @return [::Google::Cloud::DataCatalog::V1::DataplexTableSpec] + # Output only. Fields specific to a Dataplex table and present only in the + # Dataplex table entries. + # @!attribute [rw] database_view_spec + # @return [::Google::Cloud::DataCatalog::V1::DatabaseTableSpec::DatabaseViewSpec] + # Spec what aplies to tables that are actually views. + # Not set for "real" tables. + class DatabaseTableSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification that applies to database view. + # @!attribute [rw] view_type + # @return [::Google::Cloud::DataCatalog::V1::DatabaseTableSpec::DatabaseViewSpec::ViewType] + # Type of this view. + # @!attribute [rw] base_table + # @return [::String] + # Name of a singular table this view reflects one to one. + # @!attribute [rw] sql_query + # @return [::String] + # SQL query used to generate this view. + class DatabaseViewSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Concrete type of the view. + module ViewType + # Default unknown view type. + VIEW_TYPE_UNSPECIFIED = 0 + + # Standard view. + STANDARD_VIEW = 1 + + # Materialized view. + MATERIALIZED_VIEW = 2 + end + end + + # Type of the table. + module TableType + # Default unknown table type. + TABLE_TYPE_UNSPECIFIED = 0 + + # Native table. + NATIVE = 1 + + # External table. + EXTERNAL = 2 + end + end + + # Specification that applies to a fileset. Valid only for entries with the + # 'FILESET' type. + # @!attribute [rw] dataplex_fileset + # @return [::Google::Cloud::DataCatalog::V1::DataplexFilesetSpec] + # Fields specific to a Dataplex fileset and present only in the Dataplex + # fileset entries. + class FilesetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification that applies to a data source connection. Valid only for + # entries with the `DATA_SOURCE_CONNECTION` type. + # Only one of internal specs can be set at the time, and cannot + # be changed later. + # @!attribute [rw] bigquery_connection_spec + # @return [::Google::Cloud::DataCatalog::V1::BigQueryConnectionSpec] + # Output only. Fields specific to BigQuery connections. + class DataSourceConnectionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification that applies to a routine. Valid only for + # entries with the `ROUTINE` type. + # @!attribute [rw] routine_type + # @return [::Google::Cloud::DataCatalog::V1::RoutineSpec::RoutineType] + # The type of the routine. + # @!attribute [rw] language + # @return [::String] + # The language the routine is written in. The exact value depends on the + # source system. For BigQuery routines, possible values are: + # + # * `SQL` + # * `JAVASCRIPT` + # @!attribute [rw] routine_arguments + # @return [::Array<::Google::Cloud::DataCatalog::V1::RoutineSpec::Argument>] + # Arguments of the routine. + # @!attribute [rw] return_type + # @return [::String] + # Return type of the argument. The exact value depends on the source system + # and the language. + # @!attribute [rw] definition_body + # @return [::String] + # The body of the routine. + # @!attribute [rw] bigquery_routine_spec + # @return [::Google::Cloud::DataCatalog::V1::BigQueryRoutineSpec] + # Fields specific for BigQuery routines. + class RoutineSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Input or output argument of a function or stored procedure. + # @!attribute [rw] name + # @return [::String] + # The name of the argument. A return argument of a function might not have + # a name. + # @!attribute [rw] mode + # @return [::Google::Cloud::DataCatalog::V1::RoutineSpec::Argument::Mode] + # Specifies whether the argument is input or output. + # @!attribute [rw] type + # @return [::String] + # Type of the argument. The exact value depends on the source system and + # the language. + class Argument + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The input or output mode of the argument. + module Mode + # Unspecified mode. + MODE_UNSPECIFIED = 0 + + # The argument is input-only. + IN = 1 + + # The argument is output-only. + OUT = 2 + + # The argument is both an input and an output. + INOUT = 3 + end + end + + # The fine-grained type of the routine. + module RoutineType + # Unspecified type. + ROUTINE_TYPE_UNSPECIFIED = 0 + + # Non-builtin permanent scalar function. + SCALAR_FUNCTION = 1 + + # Stored procedure. + PROCEDURE = 2 + end + end + + # Specification that applies to a dataset. Valid only for + # entries with the `DATASET` type. + # @!attribute [rw] vertex_dataset_spec + # @return [::Google::Cloud::DataCatalog::V1::VertexDatasetSpec] + # Vertex AI Dataset specific fields + class DatasetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification that applies to + # entries that are part `SQL_DATABASE` system + # (user_specified_type) + # @!attribute [rw] sql_engine + # @return [::String] + # SQL Database Engine. + # enum SqlEngine { + # UNDEFINED = 0; + # MY_SQL = 1; + # POSTGRE_SQL = 2; + # SQL_SERVER = 3; + # } + # Engine of the enclosing database instance. + # @!attribute [rw] database_version + # @return [::String] + # Version of the database engine. + # @!attribute [rw] instance_host + # @return [::String] + # Host of the SQL database + # enum InstanceHost { + # UNDEFINED = 0; + # SELF_HOSTED = 1; + # CLOUD_SQL = 2; + # AMAZON_RDS = 3; + # AZURE_SQL = 4; + # } + # Host of the enclousing database instance. + class SqlDatabaseSystemSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification that applies to + # entries that are part `LOOKER` system + # (user_specified_type) + # @!attribute [rw] parent_instance_id + # @return [::String] + # ID of the parent Looker Instance. Empty if it does not exist. + # Example value: `someinstance.looker.com` + # @!attribute [rw] parent_instance_display_name + # @return [::String] + # Name of the parent Looker Instance. Empty if it does not exist. + # @!attribute [rw] parent_model_id + # @return [::String] + # ID of the parent Model. Empty if it does not exist. + # @!attribute [rw] parent_model_display_name + # @return [::String] + # Name of the parent Model. Empty if it does not exist. + # @!attribute [rw] parent_view_id + # @return [::String] + # ID of the parent View. Empty if it does not exist. + # @!attribute [rw] parent_view_display_name + # @return [::String] + # Name of the parent View. Empty if it does not exist. + class LookerSystemSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification that applies to + # all entries that are part of `CLOUD_BIGTABLE` system + # (user_specified_type) + # @!attribute [rw] instance_display_name + # @return [::String] + # Display name of the Instance. This is user specified and different from + # the resource name. + class CloudBigtableSystemSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification that applies to Instance + # entries that are part of `CLOUD_BIGTABLE` system. + # (user_specified_type) + # @!attribute [rw] cloud_bigtable_cluster_specs + # @return [::Array<::Google::Cloud::DataCatalog::V1::CloudBigtableInstanceSpec::CloudBigtableClusterSpec>] + # The list of clusters for the Instance. + class CloudBigtableInstanceSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Spec that applies to clusters of an Instance of Cloud Bigtable. + # @!attribute [rw] display_name + # @return [::String] + # Name of the cluster. + # @!attribute [rw] location + # @return [::String] + # Location of the cluster, typically a Cloud zone. + # @!attribute [rw] type + # @return [::String] + # Type of the resource. For a cluster this would be "CLUSTER". + # @!attribute [rw] linked_resource + # @return [::String] + # A link back to the parent resource, in this case Instance. + class CloudBigtableClusterSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specification that applies to a Service resource. Valid only + # for entries with the `SERVICE` type. + # @!attribute [rw] cloud_bigtable_instance_spec + # @return [::Google::Cloud::DataCatalog::V1::CloudBigtableInstanceSpec] + # Specification that applies to Instance entries of `CLOUD_BIGTABLE` + # system. + class ServiceSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detail description of the source information of a Vertex model. + # @!attribute [rw] source_type + # @return [::Google::Cloud::DataCatalog::V1::VertexModelSourceInfo::ModelSourceType] + # Type of the model source. + # @!attribute [rw] copy + # @return [::Boolean] + # If this Model is copy of another Model. If true then + # {::Google::Cloud::DataCatalog::V1::VertexModelSourceInfo#source_type source_type} + # pertains to the original. + class VertexModelSourceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Source of the model. + module ModelSourceType + # Should not be used. + MODEL_SOURCE_TYPE_UNSPECIFIED = 0 + + # The Model is uploaded by automl training pipeline. + AUTOML = 1 + + # The Model is uploaded by user or custom training pipeline. + CUSTOM = 2 + + # The Model is registered and sync'ed from BigQuery ML. + BQML = 3 + + # The Model is saved or tuned from Model Garden. + MODEL_GARDEN = 4 + + # The Model is saved or tuned from Genie. + GENIE = 5 + + # The Model is uploaded by text embedding finetuning pipeline. + CUSTOM_TEXT_EMBEDDING = 6 + + # The Model is saved or tuned from Marketplace. + MARKETPLACE = 7 + end + end + + # Specification for vertex model resources. + # @!attribute [rw] version_id + # @return [::String] + # The version ID of the model. + # @!attribute [rw] version_aliases + # @return [::Array<::String>] + # User provided version aliases so that a model version can be referenced via + # alias + # @!attribute [rw] version_description + # @return [::String] + # The description of this version. + # @!attribute [rw] vertex_model_source_info + # @return [::Google::Cloud::DataCatalog::V1::VertexModelSourceInfo] + # Source of a Vertex model. + # @!attribute [rw] container_image_uri + # @return [::String] + # URI of the Docker image to be used as the custom container for serving + # predictions. + class VertexModelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification for vertex dataset resources. + # @!attribute [rw] data_item_count + # @return [::Integer] + # The number of DataItems in this Dataset. Only apply for non-structured + # Dataset. + # @!attribute [rw] data_type + # @return [::Google::Cloud::DataCatalog::V1::VertexDatasetSpec::DataType] + # Type of the dataset. + class VertexDatasetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of data stored in the dataset. + module DataType + # Should not be used. + DATA_TYPE_UNSPECIFIED = 0 + + # Structured data dataset. + TABLE = 1 + + # Image dataset which supports ImageClassification, ImageObjectDetection + # and ImageSegmentation problems. + IMAGE = 2 + + # Document dataset which supports TextClassification, TextExtraction and + # TextSentiment problems. + TEXT = 3 + + # Video dataset which supports VideoClassification, VideoObjectTracking and + # VideoActionRecognition problems. + VIDEO = 4 + + # Conversation dataset which supports conversation problems. + CONVERSATION = 5 + + # TimeSeries dataset. + TIME_SERIES = 6 + + # Document dataset which supports DocumentAnnotation problems. + DOCUMENT = 7 + + # TextToSpeech dataset which supports TextToSpeech problems. + TEXT_TO_SPEECH = 8 + + # Translation dataset which supports Translation problems. + TRANSLATION = 9 + + # Store Vision dataset which is used for HITL integration. + STORE_VISION = 10 + + # Enterprise Knowledge Graph dataset which is used for HITL labeling + # integration. + ENTERPRISE_KNOWLEDGE_GRAPH = 11 + + # Text prompt dataset which supports Large Language Models. + TEXT_PROMPT = 12 + end + end + + # Specification that applies to a model. Valid only for + # entries with the `MODEL` type. + # @!attribute [rw] vertex_model_spec + # @return [::Google::Cloud::DataCatalog::V1::VertexModelSpec] + # Specification for vertex model resources. + class ModelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detail description of the source information of a Vertex Feature Online + # Store. + # @!attribute [r] storage_type + # @return [::Google::Cloud::DataCatalog::V1::FeatureOnlineStoreSpec::StorageType] + # Output only. Type of underelaying storage for the FeatureOnlineStore. + class FeatureOnlineStoreSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of underlaying storage type. + module StorageType + # Should not be used. + STORAGE_TYPE_UNSPECIFIED = 0 + + # Underlsying storgae is Bigtable. + BIGTABLE = 1 + + # Underlaying is optimized online server (Lightning). + OPTIMIZED = 2 + end + end + + # Business Context of the entry. + # @!attribute [rw] entry_overview + # @return [::Google::Cloud::DataCatalog::V1::EntryOverview] + # Entry overview fields for rich text descriptions of entries. + # @!attribute [rw] contacts + # @return [::Google::Cloud::DataCatalog::V1::Contacts] + # Contact people for the entry. + class BusinessContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Entry overview fields for rich text descriptions of entries. + # @!attribute [rw] overview + # @return [::String] + # Entry overview with support for rich text. + # + # The overview must only contain Unicode characters, and should be + # formatted using HTML. + # The maximum length is 10 MiB as this value holds HTML descriptions + # including encoded images. The maximum length of the text without images + # is 100 KiB. + class EntryOverview + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contact people for the entry. + # @!attribute [rw] people + # @return [::Array<::Google::Cloud::DataCatalog::V1::Contacts::Person>] + # The list of contact people for the entry. + class Contacts + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A contact person for the entry. + # @!attribute [rw] designation + # @return [::String] + # Designation of the person, for example, Data Steward. + # @!attribute [rw] email + # @return [::String] + # Email of the person in the format of `john.doe@xyz`, + # ``, or `John Doe`. + class Person + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Entry group metadata. + # + # An `EntryGroup` resource represents a logical grouping of zero or more + # Data Catalog {::Google::Cloud::DataCatalog::V1::Entry Entry} resources. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the entry group in URL format. + # + # Note: The entry group itself and its child resources might not be + # stored in the location specified in its name. + # @!attribute [rw] display_name + # @return [::String] + # A short name to identify the entry group, for example, + # "analytics data - jan 2011". Default value is an empty string. + # @!attribute [rw] description + # @return [::String] + # Entry group description. Can consist of several sentences or + # paragraphs that describe the entry group contents. + # Default value is an empty string. + # @!attribute [r] data_catalog_timestamps + # @return [::Google::Cloud::DataCatalog::V1::SystemTimestamps] + # Output only. Timestamps of the entry group. Default value is empty. + # @!attribute [rw] transferred_to_dataplex + # @return [::Boolean] + # Optional. When set to [true], it means DataCatalog EntryGroup was + # transferred to Dataplex Catalog Service. It makes EntryGroup and its + # Entries to be read-only in DataCatalog. However, new Tags on EntryGroup and + # its Entries can be created. After setting the flag to [true] it cannot be + # unset. + class EntryGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template CreateTagTemplate}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project and the template location + # [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + # @!attribute [rw] tag_template_id + # @return [::String] + # Required. The ID of the tag template to create. + # + # The ID must contain only lowercase letters (a-z), numbers (0-9), + # or underscores (_), and must start with a letter or underscore. + # The maximum size is 64 bytes when encoded in UTF-8. + # @!attribute [rw] tag_template + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # Required. The tag template to create. + class CreateTagTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_tag_template GetTagTemplate}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tag template to get. + class GetTagTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template UpdateTagTemplate}. + # @!attribute [rw] tag_template + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate] + # Required. The template to update. The `name` field must be set. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Names of fields whose values to overwrite on a tag template. Currently, + # only `display_name` and `is_publicly_readable` can be overwritten. + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + # + # Note: Updating the `is_publicly_readable` field may require up to 12 + # hours to take effect in search results. + class UpdateTagTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template DeleteTagTemplate}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tag template to delete. + # @!attribute [rw] force + # @return [::Boolean] + # Required. If true, deletes all tags that use this template. + # + # Currently, `true` is the only supported value. + class DeleteTagTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag CreateTag}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the resource to attach this tag to. + # + # Tags can be attached to entries or entry groups. An entry can have up to + # 1000 attached tags. + # + # Note: The tag and its child resources might not be stored in + # the location specified in its name. + # @!attribute [rw] tag + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # Required. The tag to create. + class CreateTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag UpdateTag}. + # @!attribute [rw] tag + # @return [::Google::Cloud::DataCatalog::V1::Tag] + # Required. The updated tag. The "name" field must be set. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Names of fields whose values to overwrite on a tag. Currently, a tag has + # the only modifiable field with the name `fields`. + # + # In general, if this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the + # request body, their values are emptied. + class UpdateTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag DeleteTag}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tag to delete. + class DeleteTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template_field CreateTagTemplateField}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project and the template location + # [region](https://cloud.google.com/data-catalog/docs/concepts/regions). + # @!attribute [rw] tag_template_field_id + # @return [::String] + # Required. The ID of the tag template field to create. + # + # Note: Adding a required field to an existing template is *not* allowed. + # + # Field IDs can contain letters (both uppercase and lowercase), numbers + # (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 + # character long and at most 128 characters long. Field IDs must also be + # unique within their template. + # @!attribute [rw] tag_template_field + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # Required. The tag template field to create. + class CreateTagTemplateFieldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template_field UpdateTagTemplateField}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tag template field. + # @!attribute [rw] tag_template_field + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + # Required. The template to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Names of fields whose values to overwrite on an individual field + # of a tag template. The following fields are modifiable: + # + # * `display_name` + # * `type.enum_type` + # * `is_required` + # + # If this parameter is absent or empty, all modifiable fields + # are overwritten. If such fields are non-required and omitted in the request + # body, their values are emptied with one exception: when updating an enum + # type, the provided values are merged with the existing values. Therefore, + # enum values can only be added, existing enum values cannot be deleted or + # renamed. + # + # Additionally, updating a template field from optional to required is + # *not* allowed. + class UpdateTagTemplateFieldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field RenameTagTemplateField}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tag template field. + # @!attribute [rw] new_tag_template_field_id + # @return [::String] + # Required. The new ID of this tag template field. For example, + # `my_new_field`. + class RenameTagTemplateFieldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field_enum_value RenameTagTemplateFieldEnumValue}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the enum field value. + # @!attribute [rw] new_enum_value_display_name + # @return [::String] + # Required. The new display name of the enum value. For example, + # `my_new_enum_value`. + class RenameTagTemplateFieldEnumValueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template_field DeleteTagTemplateField}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the tag template field to delete. + # @!attribute [rw] force + # @return [::Boolean] + # Required. If true, deletes this field from any tags that use it. + # + # Currently, `true` is the only supported value. + class DeleteTagTemplateFieldRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags ListTags}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the Data Catalog resource to list the tags of. + # + # The resource can be an {::Google::Cloud::DataCatalog::V1::Entry Entry} + # or an {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup} + # (without `/entries/{entries}` at the end). + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of tags to return. Default is 10. Maximum limit is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Pagination token that specifies the next page to return. If empty, the + # first page is returned. + class ListTagsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags ListTags}. + # @!attribute [rw] tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::Tag>] + # {::Google::Cloud::DataCatalog::V1::Tag Tag} details. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token of the next results page. Empty if there are + # no more items in results. + class ListTagsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#reconcile_tags ReconcileTags}. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of {::Google::Cloud::DataCatalog::V1::Entry Entry} to be tagged. + # @!attribute [rw] tag_template + # @return [::String] + # Required. The name of the tag template, which is used for reconciliation. + # @!attribute [rw] force_delete_missing + # @return [::Boolean] + # If set to `true`, deletes entry tags related to a tag template + # not listed in the tags source from an entry. If set to `false`, + # unlisted tags are retained. + # @!attribute [rw] tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::Tag>] + # A list of tags to apply to an entry. A tag can specify a + # tag template, which must be the template specified in the + # `ReconcileTagsRequest`. + # The sole entry and each of its columns must be mentioned at most once. + class ReconcileTagsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Longrunning::Operation Long-running operation} + # response message returned by + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#reconcile_tags ReconcileTags}. + # @!attribute [rw] created_tags_count + # @return [::Integer] + # Number of tags created in the request. + # @!attribute [rw] updated_tags_count + # @return [::Integer] + # Number of tags updated in the request. + # @!attribute [rw] deleted_tags_count + # @return [::Integer] + # Number of tags deleted in the request. + class ReconcileTagsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # {::Google::Longrunning::Operation Long-running operation} + # metadata message returned by the + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#reconcile_tags ReconcileTags}. + # @!attribute [rw] state + # @return [::Google::Cloud::DataCatalog::V1::ReconcileTagsMetadata::ReconciliationState] + # State of the reconciliation operation. + # @!attribute [rw] errors + # @return [::Google::Protobuf::Map{::String => ::Google::Rpc::Status}] + # Maps the name of each tagged column (or empty string for a + # sole entry) to tagging operation {::Google::Rpc::Status status}. + class ReconcileTagsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Rpc::Status] + class ErrorsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enum holding possible states of the reconciliation operation. + module ReconciliationState + # Default value. This value is unused. + RECONCILIATION_STATE_UNSPECIFIED = 0 + + # The reconciliation has been queued and awaits for execution. + RECONCILIATION_QUEUED = 1 + + # The reconciliation is in progress. + RECONCILIATION_IN_PROGRESS = 2 + + # The reconciliation has been finished. + RECONCILIATION_DONE = 3 + end + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entries ListEntries}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the entry group that contains the entries to list. + # + # Can be provided in URL format. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default is 10. Maximum limit is + # 1000. Throws an invalid argument if `page_size` is more than 1000. + # @!attribute [rw] page_token + # @return [::String] + # Pagination token that specifies the next page to return. If empty, the + # first page is returned. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # The fields to return for each entry. If empty or omitted, all + # fields are returned. + # + # For example, to return a list of entries with only the `name` field, + # set `read_mask` to only one path with the `name` value. + class ListEntriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entries ListEntries}. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::DataCatalog::V1::Entry>] + # Entry details. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token of the next results page. Empty if there are no more items + # in results. + class ListEntriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#star_entry StarEntry}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entry to mark as starred. + class StarEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#star_entry StarEntry}. + # Empty for now + class StarEntryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#unstar_entry UnstarEntry}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entry to mark as **not** starred. + class UnstarEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#unstar_entry UnstarEntry}. + # Empty for now + class UnstarEntryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#import_entries ImportEntries} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Target entry group for ingested entries. + # @!attribute [rw] gcs_bucket_path + # @return [::String] + # Path to a Cloud Storage bucket that contains a dump ready for ingestion. + # @!attribute [rw] job_id + # @return [::String] + # Optional. (Optional) Dataplex task job id, if specified will be used as + # part of ImportEntries LRO ID + class ImportEntriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for {::Google::Longrunning::Operation long-running operation} + # returned by the + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#import_entries ImportEntries}. + # @!attribute [rw] upserted_entries_count + # @return [::Integer] + # Cumulative number of entries created and entries updated as a result of + # import operation. + # @!attribute [rw] deleted_entries_count + # @return [::Integer] + # Number of entries deleted as a result of import operation. + class ImportEntriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for {::Google::Longrunning::Operation long-running operation} + # returned by the + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#import_entries ImportEntries}. + # @!attribute [rw] state + # @return [::Google::Cloud::DataCatalog::V1::ImportEntriesMetadata::ImportState] + # State of the import operation. + # @!attribute [rw] errors + # @return [::Array<::Google::Rpc::Status>] + # Partial errors that are encountered during the ImportEntries operation. + # There is no guarantee that all the encountered errors are reported. + # However, if no errors are reported, it means that no errors were + # encountered. + class ImportEntriesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum holding possible states of the import operation. + module ImportState + # Default value. This value is unused. + IMPORT_STATE_UNSPECIFIED = 0 + + # The dump with entries has been queued for import. + IMPORT_QUEUED = 1 + + # The import of entries is in progress. + IMPORT_IN_PROGRESS = 2 + + # The import of entries has been finished. + IMPORT_DONE = 3 + + # The import of entries has been abandoned in favor of a newer request. + IMPORT_OBSOLETE = 4 + end + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_overview ModifyEntryOverview}. + # @!attribute [rw] name + # @return [::String] + # Required. The full resource name of the entry. + # @!attribute [rw] entry_overview + # @return [::Google::Cloud::DataCatalog::V1::EntryOverview] + # Required. The new value for the Entry Overview. + class ModifyEntryOverviewRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_contacts ModifyEntryContacts}. + # @!attribute [rw] name + # @return [::String] + # Required. The full resource name of the entry. + # @!attribute [rw] contacts + # @return [::Google::Cloud::DataCatalog::V1::Contacts] + # Required. The new value for the Contacts. + class ModifyEntryContactsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_config SetConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The organization or project whose config is being specified. + # @!attribute [rw] tag_template_migration + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateMigration] + # Opt-in status for the migration of Tag Templates to Dataplex. + # @!attribute [rw] catalog_ui_experience + # @return [::Google::Cloud::DataCatalog::V1::CatalogUIExperience] + # Opt-in status for the UI switch to Dataplex. + class SetConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_config RetrieveConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The organization whose config is being retrieved. + class RetrieveConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_effective_config RetrieveEffectiveConfig}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource whose effective config is being retrieved. + class RetrieveEffectiveConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration related to the migration from Data Catalog to Dataplex that + # has been applied to an organization and any projects under it. It is the + # response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_config RetrieveConfig}. + # @!attribute [rw] config + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DataCatalog::V1::MigrationConfig}] + # Map of organizations and project resource names and their configuration. + # The format for the map keys is `organizations/{organizationId}` or + # `projects/{projectId}`. + class OrganizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DataCatalog::V1::MigrationConfig] + class ConfigEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The configuration related to the migration to Dataplex applied to an + # organization or project. + # It is the response message for + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_config SetConfig} and + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_effective_config RetrieveEffectiveConfig}. + # @!attribute [rw] tag_template_migration + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateMigration] + # Opt-in status for the migration of Tag Templates to Dataplex. + # @!attribute [rw] catalog_ui_experience + # @return [::Google::Cloud::DataCatalog::V1::CatalogUIExperience] + # Opt-in status for the UI switch to Dataplex. + class MigrationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata automatically ingested from Google Cloud resources like BigQuery + # tables or Pub/Sub topics always uses enum values from `EntryType` as the type + # of entry. + # + # Other sources of metadata like Hive or Oracle databases can identify the type + # by either using one of the enum values from `EntryType` (for example, + # `FILESET` for a Cloud Storage fileset) or specifying a custom value using + # the [`Entry`](#resource:-entry) field `user_specified_type`. For more + # information, see + # [Surface files from Cloud Storage with fileset + # entries](/data-catalog/docs/how-to/filesets) or [Create custom entries for + # your data sources](/data-catalog/docs/how-to/custom-entries). + module EntryType + # Default unknown type. + ENTRY_TYPE_UNSPECIFIED = 0 + + # The entry type that has a GoogleSQL schema, including + # logical views. + TABLE = 2 + + # The type of models. + # + # For more information, see [Supported models in BigQuery + # ML](/bigquery/docs/bqml-introduction#supported_models). + MODEL = 5 + + # An entry type for streaming entries. For example, a Pub/Sub topic. + DATA_STREAM = 3 + + # An entry type for a set of files or objects. For example, a + # Cloud Storage fileset. + FILESET = 4 + + # A group of servers that work together. For example, a Kafka cluster. + CLUSTER = 6 + + # A database. + DATABASE = 7 + + # Connection to a data source. For example, a BigQuery + # connection. + DATA_SOURCE_CONNECTION = 8 + + # Routine, for example, a BigQuery routine. + ROUTINE = 9 + + # A Dataplex lake. + LAKE = 10 + + # A Dataplex zone. + ZONE = 11 + + # A service, for example, a Dataproc Metastore service. + SERVICE = 14 + + # Schema within a relational database. + DATABASE_SCHEMA = 15 + + # A Dashboard, for example from Looker. + DASHBOARD = 16 + + # A Looker Explore. + # + # For more information, see [Looker Explore API] + # (https://developers.looker.com/api/explorer/4.0/methods/LookmlModel/lookml_model_explore). + EXPLORE = 17 + + # A Looker Look. + # + # For more information, see [Looker Look API] + # (https://developers.looker.com/api/explorer/4.0/methods/Look). + LOOK = 18 + + # Feature Online Store resource in Vertex AI Feature Store. + FEATURE_ONLINE_STORE = 19 + + # Feature View resource in Vertex AI Feature Store. + FEATURE_VIEW = 20 + + # Feature Group resource in Vertex AI Feature Store. + FEATURE_GROUP = 21 + end + + # Configuration related to the opt-in status for the migration of TagTemplates + # to Dataplex. + module TagTemplateMigration + # Default value. Migration of Tag Templates from Data Catalog to Dataplex is + # not performed. + TAG_TEMPLATE_MIGRATION_UNSPECIFIED = 0 + + # Migration of Tag Templates from Data Catalog to Dataplex is enabled. + TAG_TEMPLATE_MIGRATION_ENABLED = 1 + + # Migration of Tag Templates from Data Catalog to Dataplex is disabled. + TAG_TEMPLATE_MIGRATION_DISABLED = 2 + end + + # Configuration related to the opt-in status for the UI switch to Dataplex. + module CatalogUIExperience + # Default value. The default UI is Dataplex. + CATALOG_UI_EXPERIENCE_UNSPECIFIED = 0 + + # The UI is Dataplex. + CATALOG_UI_EXPERIENCE_ENABLED = 1 + + # The UI is Data Catalog. + CATALOG_UI_EXPERIENCE_DISABLED = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/dataplex_spec.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/dataplex_spec.rb new file mode 100644 index 000000000000..6bbba17ad993 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/dataplex_spec.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Common Dataplex fields. + # @!attribute [rw] asset + # @return [::String] + # Fully qualified resource name of an asset in Dataplex, to which the + # underlying data source (Cloud Storage bucket or BigQuery dataset) of the + # entity is attached. + # @!attribute [rw] data_format + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema] + # Format of the data. + # @!attribute [rw] compression_format + # @return [::String] + # Compression format of the data, e.g., zip, gzip etc. + # @!attribute [rw] project_id + # @return [::String] + # Project ID of the underlying Cloud Storage or BigQuery data. Note that + # this may not be the same project as the correspondingly Dataplex lake / + # zone / asset. + class DataplexSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Entry specyfication for a Dataplex fileset. + # @!attribute [rw] dataplex_spec + # @return [::Google::Cloud::DataCatalog::V1::DataplexSpec] + # Common Dataplex fields. + class DataplexFilesetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Entry specification for a Dataplex table. + # @!attribute [rw] external_tables + # @return [::Array<::Google::Cloud::DataCatalog::V1::DataplexExternalTable>] + # List of external tables registered by Dataplex in other systems based on + # the same underlying data. + # + # External tables allow to query this data in those systems. + # @!attribute [rw] dataplex_spec + # @return [::Google::Cloud::DataCatalog::V1::DataplexSpec] + # Common Dataplex fields. + # @!attribute [rw] user_managed + # @return [::Boolean] + # Indicates if the table schema is managed by the user or not. + class DataplexTableSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # External table registered by Dataplex. + # Dataplex publishes data discovered from an asset into multiple other systems + # (BigQuery, DPMS) in form of tables. We call them "external tables". External + # tables are also synced into the Data Catalog. + # This message contains pointers to + # those external tables (fully qualified name, resource name et cetera) within + # the Data Catalog. + # @!attribute [rw] system + # @return [::Google::Cloud::DataCatalog::V1::IntegratedSystem] + # Service in which the external table is registered. + # @!attribute [rw] fully_qualified_name + # @return [::String] + # Fully qualified name (FQN) of the external table. + # @!attribute [rw] google_cloud_resource + # @return [::String] + # Google Cloud resource name of the external table. + # @!attribute [rw] data_catalog_entry + # @return [::String] + # Name of the Data Catalog entry representing the external table. + class DataplexExternalTable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/dump_content.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/dump_content.rb new file mode 100644 index 000000000000..e25d3871e02e --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/dump_content.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Wrapper containing Entry and information about Tags + # that should and should not be attached to it. + # @!attribute [rw] v1_entry + # @return [::Google::Cloud::DataCatalog::V1::Entry] + # Non-encrypted Data Catalog v1 Entry. + # @!attribute [rw] present_tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::Tag>] + # Optional. Tags that should be ingested into the Data Catalog. + # Caller should populate template name, column and fields. + # @!attribute [rw] absent_tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::Tag>] + # Optional. Tags that should be deleted from the Data Catalog. + # Caller should populate template name and column only. + class TaggedEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper for any item that can be contained in the dump. + # @!attribute [rw] tagged_entry + # @return [::Google::Cloud::DataCatalog::V1::TaggedEntry] + # Entry and its tags. + class DumpItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb new file mode 100644 index 000000000000..9d4ad351c30f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/gcs_fileset_spec.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Describes a Cloud Storage fileset entry. + # @!attribute [rw] file_patterns + # @return [::Array<::String>] + # Required. Patterns to identify a set of files in Google Cloud Storage. + # + # For more information, see [Wildcard Names] + # (https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). + # + # Note: Currently, bucket wildcards are not supported. + # + # Examples of valid `file_patterns`: + # + # * `gs://bucket_name/dir/*`: matches all files in `bucket_name/dir` + # directory + # * `gs://bucket_name/dir/**`: matches all files in `bucket_name/dir` + # and all subdirectories + # * `gs://bucket_name/file*`: matches files prefixed by `file` in + # `bucket_name` + # * `gs://bucket_name/??.txt`: matches files with two characters followed by + # `.txt` in `bucket_name` + # * `gs://bucket_name/[aeiou].txt`: matches files that contain a single + # vowel character followed by `.txt` in + # `bucket_name` + # * `gs://bucket_name/[a-m].txt`: matches files that contain `a`, `b`, ... + # or `m` followed by `.txt` in `bucket_name` + # * `gs://bucket_name/a/*/b`: matches all files in `bucket_name` that match + # the `a/*/b` pattern, such as `a/c/b`, `a/d/b` + # * `gs://another_bucket/a.txt`: matches `gs://another_bucket/a.txt` + # + # You can combine wildcards to match complex sets of files, for example: + # + # `gs://bucket_name/[a-m]??.j*g` + # @!attribute [r] sample_gcs_file_specs + # @return [::Array<::Google::Cloud::DataCatalog::V1::GcsFileSpec>] + # Output only. Sample files contained in this fileset, not all files + # contained in this fileset are represented here. + class GcsFilesetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of a single file in Cloud Storage. + # @!attribute [rw] file_path + # @return [::String] + # Required. Full file path. Example: `gs://bucket_name/a/b.txt`. + # @!attribute [r] gcs_timestamps + # @return [::Google::Cloud::DataCatalog::V1::SystemTimestamps] + # Output only. Creation, modification, and expiration timestamps of a Cloud + # Storage file. + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. File size in bytes. + class GcsFileSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/physical_schema.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/physical_schema.rb new file mode 100644 index 000000000000..5fc772496d9f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/physical_schema.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Native schema used by a resource represented as an entry. Used by query + # engines for deserializing and parsing source data. + # @!attribute [rw] avro + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema::AvroSchema] + # Schema in Avro JSON format. + # @!attribute [rw] thrift + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema::ThriftSchema] + # Schema in Thrift format. + # @!attribute [rw] protobuf + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema::ProtobufSchema] + # Schema in protocol buffer format. + # @!attribute [rw] parquet + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema::ParquetSchema] + # Marks a Parquet-encoded data source. + # @!attribute [rw] orc + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema::OrcSchema] + # Marks an ORC-encoded data source. + # @!attribute [rw] csv + # @return [::Google::Cloud::DataCatalog::V1::PhysicalSchema::CsvSchema] + # Marks a CSV-encoded data source. + class PhysicalSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Schema in Avro JSON format. + # @!attribute [rw] text + # @return [::String] + # JSON source of the Avro schema. + class AvroSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Schema in Thrift format. + # @!attribute [rw] text + # @return [::String] + # Thrift IDL source of the schema. + class ThriftSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Schema in protocol buffer format. + # @!attribute [rw] text + # @return [::String] + # Protocol buffer source of the schema. + class ProtobufSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Marks a Parquet-encoded data source. + class ParquetSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Marks an ORC-encoded data source. + class OrcSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Marks a CSV-encoded data source. + class CsvSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb new file mode 100644 index 000000000000..f0bb37ad48c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/policytagmanager.rb @@ -0,0 +1,340 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # A taxonomy is a collection of hierarchical policy tags that classify data + # along a common axis. + # + # For example, a "data sensitivity" taxonomy might contain the following policy + # tags: + # + # ``` + # + PII + # + Account number + # + Age + # + SSN + # + Zipcode + # + Financials + # + Revenue + # ``` + # + # A "data origin" taxonomy might contain the following policy tags: + # + # ``` + # + User data + # + Employee data + # + Partner data + # + Public data + # ``` + # @!attribute [rw] name + # @return [::String] + # Identifier. Resource name of this taxonomy in URL format. + # + # Note: Policy tag manager generates unique taxonomy IDs. + # @!attribute [rw] display_name + # @return [::String] + # Required. User-defined name of this taxonomy. + # + # The name can't start or end with spaces, must contain only Unicode letters, + # numbers, underscores, dashes, and spaces, and be at most 200 bytes long + # when encoded in UTF-8. + # + # The taxonomy display name must be unique within an organization. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of this taxonomy. If not set, defaults to empty. + # + # The description must contain only Unicode characters, tabs, newlines, + # carriage returns, and page breaks, and be at most 2000 bytes long when + # encoded in UTF-8. + # @!attribute [r] policy_tag_count + # @return [::Integer] + # Output only. Number of policy tags in this taxonomy. + # @!attribute [r] taxonomy_timestamps + # @return [::Google::Cloud::DataCatalog::V1::SystemTimestamps] + # Output only. Creation and modification timestamps of this taxonomy. + # @!attribute [rw] activated_policy_types + # @return [::Array<::Google::Cloud::DataCatalog::V1::Taxonomy::PolicyType>] + # Optional. A list of policy types that are activated for this taxonomy. If + # not set, defaults to an empty list. + # @!attribute [r] service + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy::Service] + # Output only. Identity of the service which owns the Taxonomy. This field is + # only populated when the taxonomy is created by a Google Cloud service. + # Currently only 'DATAPLEX' is supported. + class Taxonomy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The source system of the Taxonomy. + # @!attribute [rw] name + # @return [::Google::Cloud::DataCatalog::V1::ManagingSystem] + # The Google Cloud service name. + # @!attribute [rw] identity + # @return [::String] + # The service agent for the service. + class Service + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines policy types where the policy tags can be used for. + module PolicyType + # Unspecified policy type. + POLICY_TYPE_UNSPECIFIED = 0 + + # Fine-grained access control policy that enables access control on + # tagged sub-resources. + FINE_GRAINED_ACCESS_CONTROL = 1 + end + end + + # Denotes one policy tag in a taxonomy, for example, SSN. + # + # Policy tags can be defined in a hierarchy. For example: + # + # ``` + # + Geolocation + # + LatLong + # + City + # + ZipCode + # ``` + # + # Where the "Geolocation" policy tag contains three children. + # @!attribute [rw] name + # @return [::String] + # Identifier. Resource name of this policy tag in the URL format. + # + # The policy tag manager generates unique taxonomy IDs and policy tag IDs. + # @!attribute [rw] display_name + # @return [::String] + # Required. User-defined name of this policy tag. + # + # The name can't start or end with spaces and must be unique within the + # parent taxonomy, contain only Unicode letters, numbers, underscores, dashes + # and spaces, and be at most 200 bytes long when encoded in UTF-8. + # @!attribute [rw] description + # @return [::String] + # Description of this policy tag. If not set, defaults to empty. + # + # The description must contain only Unicode characters, + # tabs, newlines, carriage returns and page breaks, and be at most 2000 bytes + # long when encoded in UTF-8. + # @!attribute [rw] parent_policy_tag + # @return [::String] + # Resource name of this policy tag's parent policy tag. If empty, this is a + # top level tag. If not set, defaults to an empty string. + # + # For example, for the "LatLong" policy tag in the example above, this field + # contains the resource name of the "Geolocation" policy tag, and, for + # "Geolocation", this field is empty. + # @!attribute [r] child_policy_tags + # @return [::Array<::String>] + # Output only. Resource names of child policy tags of this policy tag. + class PolicyTag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_taxonomy CreateTaxonomy}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project that the taxonomy will belong to. + # @!attribute [rw] taxonomy + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # The taxonomy to create. + class CreateTaxonomyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_taxonomy DeleteTaxonomy}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the taxonomy to delete. + # + # Note: All policy tags in this taxonomy are also deleted. + class DeleteTaxonomyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_taxonomy UpdateTaxonomy}. + # @!attribute [rw] taxonomy + # @return [::Google::Cloud::DataCatalog::V1::Taxonomy] + # The taxonomy to update. You can update only its description, display name, + # and activated policy types. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies fields to update. If not set, defaults to all fields you can + # update. + # + # For more information, see [FieldMask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). + class UpdateTaxonomyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_taxonomies ListTaxonomies}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project to list the taxonomies of. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Must be a value between 1 and 1000 + # inclusively. If not set, defaults to 50. + # @!attribute [rw] page_token + # @return [::String] + # The pagination token of the next results page. If not set, + # the first page is returned. + # + # The token is returned in the response to a previous list request. + # @!attribute [rw] filter + # @return [::String] + # Supported field for filter is 'service' and value is 'dataplex'. + # Eg: service=dataplex. + class ListTaxonomiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_taxonomies ListTaxonomies}. + # @!attribute [rw] taxonomies + # @return [::Array<::Google::Cloud::DataCatalog::V1::Taxonomy>] + # Taxonomies that the project contains. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token of the next results page. Empty if there are no + # more results in the list. + class ListTaxonomiesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_taxonomy GetTaxonomy}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the taxonomy to get. + class GetTaxonomyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_policy_tag CreatePolicyTag}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the taxonomy that the policy tag will belong to. + # @!attribute [rw] policy_tag + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # The policy tag to create. + class CreatePolicyTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_policy_tag DeletePolicyTag}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the policy tag to delete. + # + # Note: All of its descendant policy tags are also deleted. + class DeletePolicyTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_policy_tag UpdatePolicyTag}. + # @!attribute [rw] policy_tag + # @return [::Google::Cloud::DataCatalog::V1::PolicyTag] + # The policy tag to update. You can update only its description, display + # name, and parent policy tag fields. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies the fields to update. + # + # You can update only display name, description, and parent policy tag. + # If not set, defaults to all updatable fields. + # For more information, see [FieldMask] + # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask). + class UpdatePolicyTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_policy_tags ListPolicyTags}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the taxonomy to list the policy tags of. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Must be a value between 1 and 1000 + # inclusively. + # If not set, defaults to 50. + # @!attribute [rw] page_token + # @return [::String] + # The pagination token of the next results page. If not set, returns the + # first page. + # + # The token is returned in the response to a previous list request. + class ListPolicyTagsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_policy_tags ListPolicyTags}. + # @!attribute [rw] policy_tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::PolicyTag>] + # The policy tags that belong to the taxonomy. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token of the next results page. Empty if there are no + # more results in the list. + class ListPolicyTagsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_policy_tag GetPolicyTag}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the policy tag. + class GetPolicyTagRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/policytagmanagerserialization.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/policytagmanagerserialization.rb new file mode 100644 index 000000000000..e89a65149457 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/policytagmanagerserialization.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # A nested protocol buffer that represents a taxonomy and the hierarchy of its + # policy tags. Used for taxonomy replacement, import, and + # export. + # @!attribute [rw] display_name + # @return [::String] + # Required. Display name of the taxonomy. At most 200 bytes when encoded in + # UTF-8. + # @!attribute [rw] description + # @return [::String] + # Description of the serialized taxonomy. At most 2000 bytes when + # encoded in UTF-8. If not set, defaults to an empty description. + # @!attribute [rw] policy_tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::SerializedPolicyTag>] + # Top level policy tags associated with the taxonomy, if any. + # @!attribute [rw] activated_policy_types + # @return [::Array<::Google::Cloud::DataCatalog::V1::Taxonomy::PolicyType>] + # A list of policy types that are activated per taxonomy. + class SerializedTaxonomy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A nested protocol buffer that represents a policy tag and all its + # descendants. + # @!attribute [rw] policy_tag + # @return [::String] + # Resource name of the policy tag. + # + # This field is ignored when calling `ImportTaxonomies`. + # @!attribute [rw] display_name + # @return [::String] + # Required. Display name of the policy tag. At most 200 bytes when encoded + # in UTF-8. + # @!attribute [rw] description + # @return [::String] + # Description of the serialized policy tag. At most + # 2000 bytes when encoded in UTF-8. If not set, defaults to an + # empty description. + # @!attribute [rw] child_policy_tags + # @return [::Array<::Google::Cloud::DataCatalog::V1::SerializedPolicyTag>] + # Children of the policy tag, if any. + class SerializedPolicyTag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#replace_taxonomy ReplaceTaxonomy}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the taxonomy to update. + # @!attribute [rw] serialized_taxonomy + # @return [::Google::Cloud::DataCatalog::V1::SerializedTaxonomy] + # Required. Taxonomy to update along with its child policy tags. + class ReplaceTaxonomyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#import_taxonomies ImportTaxonomies}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of project that the imported taxonomies will belong + # to. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DataCatalog::V1::InlineSource] + # Inline source taxonomy to import. + # @!attribute [rw] cross_regional_source + # @return [::Google::Cloud::DataCatalog::V1::CrossRegionalSource] + # Cross-regional source taxonomy to import. + class ImportTaxonomiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Inline source containing taxonomies to import. + # @!attribute [rw] taxonomies + # @return [::Array<::Google::Cloud::DataCatalog::V1::SerializedTaxonomy>] + # Required. Taxonomies to import. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cross-regional source used to import an existing taxonomy into a different + # region. + # @!attribute [rw] taxonomy + # @return [::String] + # Required. The resource name of the source taxonomy to import. + class CrossRegionalSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#import_taxonomies ImportTaxonomies}. + # @!attribute [rw] taxonomies + # @return [::Array<::Google::Cloud::DataCatalog::V1::Taxonomy>] + # Imported taxonomies. + class ImportTaxonomiesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#export_taxonomies ExportTaxonomies}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project that the exported taxonomies belong + # to. + # @!attribute [rw] taxonomies + # @return [::Array<::String>] + # Required. Resource names of the taxonomies to export. + # @!attribute [rw] serialized_taxonomies + # @return [::Boolean] + # Serialized export taxonomies that contain all the policy + # tags as nested protocol buffers. + class ExportTaxonomiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#export_taxonomies ExportTaxonomies}. + # @!attribute [rw] taxonomies + # @return [::Array<::Google::Cloud::DataCatalog::V1::SerializedTaxonomy>] + # List of taxonomies and policy tags as nested protocol buffers. + class ExportTaxonomiesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/schema.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/schema.rb new file mode 100644 index 000000000000..1065ad4c9ea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/schema.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Represents a schema, for example, a BigQuery, GoogleSQL, or Avro schema. + # @!attribute [rw] columns + # @return [::Array<::Google::Cloud::DataCatalog::V1::ColumnSchema>] + # The unified GoogleSQL-like schema of columns. + # + # The overall maximum number of columns and nested columns is 10,000. + # The maximum nested depth is 15 levels. + class Schema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A column within a schema. Columns can be nested inside + # other columns. + # @!attribute [rw] column + # @return [::String] + # Required. Name of the column. + # + # Must be a UTF-8 string without dots (.). + # The maximum size is 64 bytes. + # @!attribute [rw] type + # @return [::String] + # Required. Type of the column. + # + # Must be a UTF-8 string with the maximum size of 128 bytes. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the column. Default value is an empty string. + # + # The description must be a UTF-8 string with the maximum size of 2000 + # bytes. + # @!attribute [rw] mode + # @return [::String] + # Optional. A column's mode indicates whether values in this column are + # required, nullable, or repeated. + # + # Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. + # Default mode is `NULLABLE`. + # @!attribute [rw] default_value + # @return [::String] + # Optional. Default value for the column. + # @!attribute [rw] ordinal_position + # @return [::Integer] + # Optional. Ordinal position + # @!attribute [rw] highest_indexing_type + # @return [::Google::Cloud::DataCatalog::V1::ColumnSchema::IndexingType] + # Optional. Most important inclusion of this column. + # @!attribute [rw] subcolumns + # @return [::Array<::Google::Cloud::DataCatalog::V1::ColumnSchema>] + # Optional. Schema of sub-columns. A column can have zero or more + # sub-columns. + # @!attribute [rw] looker_column_spec + # @return [::Google::Cloud::DataCatalog::V1::ColumnSchema::LookerColumnSpec] + # Looker specific column info of this column. + # @!attribute [rw] range_element_type + # @return [::Google::Cloud::DataCatalog::V1::ColumnSchema::FieldElementType] + # Optional. The subtype of the RANGE, if the type of this field is RANGE. If + # the type is RANGE, this field is required. Possible values for the field + # element type of a RANGE include: + # * DATE + # * DATETIME + # * TIMESTAMP + # @!attribute [rw] gc_rule + # @return [::String] + # Optional. Garbage collection policy for the column or column family. + # Applies to systems like Cloud Bigtable. + class ColumnSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Column info specific to Looker System. + # @!attribute [rw] type + # @return [::Google::Cloud::DataCatalog::V1::ColumnSchema::LookerColumnSpec::LookerColumnType] + # Looker specific column type of this column. + class LookerColumnSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Column type in Looker. + module LookerColumnType + # Unspecified. + LOOKER_COLUMN_TYPE_UNSPECIFIED = 0 + + # Dimension. + DIMENSION = 1 + + # Dimension group - parent for Dimension. + DIMENSION_GROUP = 2 + + # Filter. + FILTER = 3 + + # Measure. + MEASURE = 4 + + # Parameter. + PARAMETER = 5 + end + end + + # Represents the type of a field element. + # @!attribute [rw] type + # @return [::String] + # Required. The type of a field element. See + # {::Google::Cloud::DataCatalog::V1::ColumnSchema#type ColumnSchema.type}. + class FieldElementType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies inclusion of the column in an index + module IndexingType + # Unspecified. + INDEXING_TYPE_UNSPECIFIED = 0 + + # Column not a part of an index. + INDEXING_TYPE_NONE = 1 + + # Column Part of non unique index. + INDEXING_TYPE_NON_UNIQUE = 2 + + # Column part of unique index. + INDEXING_TYPE_UNIQUE = 3 + + # Column part of the primary key. + INDEXING_TYPE_PRIMARY_KEY = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/search.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/search.rb new file mode 100644 index 000000000000..0d3b1c6616a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/search.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Result in the response to a search request. + # + # Each result captures details of one entry that matches the search. + # @!attribute [rw] search_result_type + # @return [::Google::Cloud::DataCatalog::V1::SearchResultType] + # Type of the search result. + # + # You can use this field to determine which get method to call to fetch the + # full resource. + # @!attribute [rw] search_result_subtype + # @return [::String] + # Sub-type of the search result. + # + # A dot-delimited full type of the resource. The same type you + # specify in the `type` search predicate. + # + # Examples: `entry.table`, `entry.dataStream`, `tagTemplate`. + # @!attribute [rw] relative_resource_name + # @return [::String] + # The relative name of the resource in URL format. + # + # Examples: + # + # * `projects/{PROJECT_ID}/locations/{LOCATION_ID}/entryGroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}` + # * `projects/{PROJECT_ID}/tagTemplates/{TAG_TEMPLATE_ID}` + # @!attribute [rw] linked_resource + # @return [::String] + # The full name of the Google Cloud resource the entry belongs to. + # + # For more information, see [Full Resource Name] + # (/apis/design/resource_names#full_resource_name). + # + # Example: + # + # `//bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID` + # @!attribute [rw] modify_time + # @return [::Google::Protobuf::Timestamp] + # The last modification timestamp of the entry in the source system. + # @!attribute [r] integrated_system + # @return [::Google::Cloud::DataCatalog::V1::IntegratedSystem] + # Output only. The source system that Data Catalog automatically integrates + # with, such as BigQuery, Cloud Pub/Sub, or Dataproc Metastore. + # @!attribute [rw] user_specified_system + # @return [::String] + # Custom source system that you can manually integrate Data Catalog with. + # @!attribute [rw] fully_qualified_name + # @return [::String] + # Fully qualified name (FQN) of the resource. + # + # FQNs take two forms: + # + # * For non-regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # * For regionalized resources: + # + # `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}` + # + # Example for a DPMS table: + # + # `dataproc_metastore:PROJECT_ID.LOCATION_ID.INSTANCE_ID.DATABASE_ID.TABLE_ID` + # @!attribute [rw] display_name + # @return [::String] + # The display name of the result. + # @!attribute [rw] description + # @return [::String] + # Entry description that can consist of several sentences or paragraphs that + # describe entry contents. + class SearchCatalogResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The resource types that can be returned in search results. + module SearchResultType + # Default unknown type. + SEARCH_RESULT_TYPE_UNSPECIFIED = 0 + + # An {::Google::Cloud::DataCatalog::V1::Entry Entry}. + ENTRY = 1 + + # A {::Google::Cloud::DataCatalog::V1::TagTemplate TagTemplate}. + TAG_TEMPLATE = 2 + + # An {::Google::Cloud::DataCatalog::V1::EntryGroup EntryGroup}. + ENTRY_GROUP = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/table_spec.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/table_spec.rb new file mode 100644 index 000000000000..a54bfe886bd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/table_spec.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Describes a BigQuery table. + # @!attribute [r] table_source_type + # @return [::Google::Cloud::DataCatalog::V1::TableSourceType] + # Output only. The table source type. + # @!attribute [rw] view_spec + # @return [::Google::Cloud::DataCatalog::V1::ViewSpec] + # Table view specification. Populated only if + # the `table_source_type` is `BIGQUERY_VIEW`. + # @!attribute [rw] table_spec + # @return [::Google::Cloud::DataCatalog::V1::TableSpec] + # Specification of a BigQuery table. Populated only if + # the `table_source_type` is `BIGQUERY_TABLE`. + class BigQueryTableSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Table view specification. + # @!attribute [r] view_query + # @return [::String] + # Output only. The query that defines the table view. + class ViewSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Normal BigQuery table specification. + # @!attribute [r] grouped_entry + # @return [::String] + # Output only. If the table is date-sharded, that is, it matches the + # `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource + # name of the date-sharded grouped entry. For example: + # + # `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. + # + # Otherwise, `grouped_entry` is empty. + class TableSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification for a group of BigQuery tables with the `[prefix]YYYYMMDD` name + # pattern. + # + # For more information, see [Introduction to partitioned tables] + # (https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding). + # @!attribute [r] dataset + # @return [::String] + # Output only. The Data Catalog resource name of the dataset entry the + # current table belongs to. For example: + # + # `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`. + # @!attribute [r] table_prefix + # @return [::String] + # Output only. The table name prefix of the shards. + # + # The name of any given shard is `[table_prefix]YYYYMMDD`. + # For example, for the `MyTable20180101` shard, the + # `table_prefix` is `MyTable`. + # @!attribute [r] shard_count + # @return [::Integer] + # Output only. Total number of shards. + # @!attribute [r] latest_shard_resource + # @return [::String] + # Output only. BigQuery resource name of the latest shard. + class BigQueryDateShardedSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Table source type. + module TableSourceType + # Default unknown type. + TABLE_SOURCE_TYPE_UNSPECIFIED = 0 + + # Table view. + BIGQUERY_VIEW = 2 + + # BigQuery native table. + BIGQUERY_TABLE = 5 + + # BigQuery materialized view. + BIGQUERY_MATERIALIZED_VIEW = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/tags.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/tags.rb new file mode 100644 index 000000000000..d5208b2e910a --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/tags.rb @@ -0,0 +1,314 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Tags contain custom metadata and are attached to Data Catalog resources. Tags + # conform with the specification of their tag template. + # + # See [Data Catalog + # IAM](https://cloud.google.com/data-catalog/docs/concepts/iam) for information + # on the permissions needed to create or view tags. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the tag in URL format where tag ID is a + # system-generated identifier. + # + # Note: The tag itself might not be stored in the location specified in its + # name. + # @!attribute [rw] template + # @return [::String] + # Required. The resource name of the tag template this tag uses. Example: + # + # `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE_ID}` + # + # This field cannot be modified after creation. + # @!attribute [r] template_display_name + # @return [::String] + # Output only. The display name of the tag template. + # @!attribute [rw] column + # @return [::String] + # Resources like entry can have schemas associated with them. This scope + # allows you to attach tags to an individual column based on that schema. + # + # To attach a tag to a nested column, separate column names with a dot + # (`.`). Example: `column.nested_column`. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DataCatalog::V1::TagField}] + # Required. Maps the ID of a tag field to its value and additional + # information about that field. + # + # Tag template defines valid field IDs. A tag + # must have at least 1 field and at most 500 fields. + # @!attribute [r] dataplex_transfer_status + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate::DataplexTransferStatus] + # Output only. Denotes the transfer status of the Tag Template. + class Tag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DataCatalog::V1::TagField] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains the value and additional information on a field within + # a {::Google::Cloud::DataCatalog::V1::Tag Tag}. + # @!attribute [r] display_name + # @return [::String] + # Output only. The display name of this field. + # @!attribute [rw] double_value + # @return [::Float] + # The value of a tag field with a double type. + # @!attribute [rw] string_value + # @return [::String] + # The value of a tag field with a string type. + # + # The maximum length is 2000 UTF-8 characters. + # @!attribute [rw] bool_value + # @return [::Boolean] + # The value of a tag field with a boolean type. + # @!attribute [rw] timestamp_value + # @return [::Google::Protobuf::Timestamp] + # The value of a tag field with a timestamp type. + # @!attribute [rw] enum_value + # @return [::Google::Cloud::DataCatalog::V1::TagField::EnumValue] + # The value of a tag field with an enum type. + # + # This value must be one of the allowed values listed in this enum. + # @!attribute [rw] richtext_value + # @return [::String] + # The value of a tag field with a rich text type. + # + # The maximum length is 10 MiB as this value holds HTML descriptions + # including encoded images. The maximum length of the text without images + # is 100 KiB. + # @!attribute [r] order + # @return [::Integer] + # Output only. The order of this field with respect to other fields in this + # tag. Can be set by + # {::Google::Cloud::DataCatalog::V1::TagTemplateField#order Tag}. + # + # For example, a higher value can indicate a more important field. + # The value can be negative. Multiple fields can have the same order, and + # field orders within a tag don't have to be sequential. + class TagField + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enum value. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the enum value. + class EnumValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A tag template defines a tag that can have one or more typed fields. + # + # The template is used to create tags that are attached to Google Cloud + # resources. [Tag template roles] + # (https://cloud.google.com/iam/docs/understanding-roles#data-catalog-roles) + # provide permissions to create, edit, and use the template. For example, + # see the [TagTemplate User] + # (https://cloud.google.com/data-catalog/docs/how-to/template-user) role + # that includes a permission to use the tag template to tag resources. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the tag template in URL format. + # + # Note: The tag template itself and its child resources might not be + # stored in the location specified in its name. + # @!attribute [rw] display_name + # @return [::String] + # Display name for this template. Defaults to an empty string. + # + # The name must contain only Unicode letters, numbers (0-9), underscores (_), + # dashes (-), spaces ( ), and can't start or end with spaces. + # The maximum length is 200 characters. + # @!attribute [rw] is_publicly_readable + # @return [::Boolean] + # Indicates whether tags created with this template are public. Public tags + # do not require tag template access to appear in + # {::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags ListTags} API response. + # + # Additionally, you can search for a public tag by value with a + # simple search query in addition to using a ``tag:`` predicate. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DataCatalog::V1::TagTemplateField}] + # Required. Map of tag template field IDs to the settings for the field. + # This map is an exhaustive list of the allowed fields. The map must contain + # at least one field and at most 500 fields. + # + # The keys to this map are tag template field IDs. The IDs have the + # following limitations: + # + # * Can contain uppercase and lowercase letters, numbers (0-9) and + # underscores (_). + # * Must be at least 1 character and at most 64 characters long. + # * Must start with a letter or underscore. + # @!attribute [rw] dataplex_transfer_status + # @return [::Google::Cloud::DataCatalog::V1::TagTemplate::DataplexTransferStatus] + # Optional. Transfer status of the TagTemplate + class TagTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DataCatalog::V1::TagTemplateField] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This enum describes TagTemplate transfer status to Dataplex service. + module DataplexTransferStatus + # Default value. TagTemplate and its tags are only visible and editable in + # DataCatalog. + DATAPLEX_TRANSFER_STATUS_UNSPECIFIED = 0 + + # TagTemplate and its tags are auto-copied to Dataplex service. + # Visible in both services. Editable in DataCatalog, read-only in Dataplex. + # Deprecated: Individual TagTemplate migration is deprecated in favor of + # organization or project wide TagTemplate migration opt-in. + MIGRATED = 1 + + # TagTemplate and its tags are auto-copied to Dataplex service. + # Visible in both services. Editable in Dataplex, read-only in DataCatalog. + TRANSFERRED = 2 + end + end + + # The template for an individual field within a tag template. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the tag template field in URL format. + # Example: + # + # `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}` + # + # Note: The tag template field itself might not be stored in the location + # specified in its name. + # + # The name must contain only letters (a-z, A-Z), numbers (0-9), + # or underscores (_), and must start with a letter or underscore. + # The maximum length is 64 characters. + # @!attribute [rw] display_name + # @return [::String] + # The display name for this field. Defaults to an empty string. + # + # The name must contain only Unicode letters, numbers (0-9), underscores (_), + # dashes (-), spaces ( ), and can't start or end with spaces. + # The maximum length is 200 characters. + # @!attribute [rw] type + # @return [::Google::Cloud::DataCatalog::V1::FieldType] + # Required. The type of value this tag field can contain. + # @!attribute [rw] is_required + # @return [::Boolean] + # If true, this field is required. Defaults to false. + # @!attribute [rw] description + # @return [::String] + # The description for this field. Defaults to an empty string. + # @!attribute [rw] order + # @return [::Integer] + # The order of this field with respect to other fields in this tag + # template. + # + # For example, a higher value can indicate a more important field. + # The value can be negative. Multiple fields can have the same order and + # field orders within a tag don't have to be sequential. + class TagTemplateField + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] primitive_type + # @return [::Google::Cloud::DataCatalog::V1::FieldType::PrimitiveType] + # Primitive types, such as string, boolean, etc. + # @!attribute [rw] enum_type + # @return [::Google::Cloud::DataCatalog::V1::FieldType::EnumType] + # An enum type. + class FieldType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] allowed_values + # @return [::Array<::Google::Cloud::DataCatalog::V1::FieldType::EnumType::EnumValue>] + # The set of allowed values for this enum. + # + # This set must not be empty and can include up to 100 allowed values. + # The display names of the values in this set must not be empty and must + # be case-insensitively unique within this set. + # + # The order of items in this set is preserved. This field can be used to + # create, remove, and reorder enum values. To rename enum values, use the + # `RenameTagTemplateFieldEnumValue` method. + class EnumType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the enum value. Must not be an empty + # string. + # + # The name must contain only Unicode letters, numbers (0-9), underscores + # (_), dashes (-), spaces ( ), and can't start or end with spaces. The + # maximum length is 200 characters. + class EnumValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + module PrimitiveType + # The default invalid value for a type. + PRIMITIVE_TYPE_UNSPECIFIED = 0 + + # A double precision number. + DOUBLE = 1 + + # An UTF-8 string. + STRING = 2 + + # A boolean value. + BOOL = 3 + + # A timestamp. + TIMESTAMP = 4 + + # A Richtext description. + RICHTEXT = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/timestamps.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/timestamps.rb new file mode 100644 index 000000000000..a668cdc778de --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/timestamps.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Timestamps associated with this resource in a particular system. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation timestamp of the resource within the given system. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of the last modification of the resource or its metadata within + # a given system. + # + # Note: Depending on the source system, not every modification updates this + # timestamp. + # For example, BigQuery timestamps every metadata modification but not data + # or permission changes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Expiration timestamp of the resource within the given system. + # + # Currently only applicable to BigQuery resources. + class SystemTimestamps + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb new file mode 100644 index 000000000000..6feaf0fa15aa --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DataCatalog + module V1 + # Detailed statistics on the entry's usage. + # + # Usage statistics have the following limitations: + # + # - Only BigQuery tables have them. + # - They only include BigQuery query jobs. + # - They might be underestimated because wildcard table references + # are not yet counted. For more information, see + # [Querying multiple tables using a wildcard table] + # (https://cloud.google.com/bigquery/docs/querying-wildcard-tables) + # @!attribute [rw] total_completions + # @return [::Float] + # The number of successful uses of the underlying entry. + # @!attribute [rw] total_failures + # @return [::Float] + # The number of failed attempts to use the underlying entry. + # @!attribute [rw] total_cancellations + # @return [::Float] + # The number of cancelled attempts to use the underlying entry. + # @!attribute [rw] total_execution_time_for_completions_millis + # @return [::Float] + # Total time spent only on successful uses, in milliseconds. + class UsageStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Common statistics on the entry's usage. + # + # They can be set on any system. + # @!attribute [rw] view_count + # @return [::Integer] + # View count in source system. + class CommonUsageStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The set of all usage signals that Data Catalog stores. + # + # Note: Usually, these signals are updated daily. In rare cases, an update may + # fail but will be performed again on the next day. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The end timestamp of the duration of usage statistics. + # @!attribute [r] usage_within_time_range + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DataCatalog::V1::UsageStats}] + # Output only. BigQuery usage statistics over each of the predefined time + # ranges. + # + # Supported time ranges are `{"24H", "7D", "30D"}`. + # @!attribute [rw] common_usage_within_time_range + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DataCatalog::V1::CommonUsageStats}] + # Common usage statistics over each of the predefined time ranges. + # + # Supported time ranges are `{"24H", "7D", "30D", "Lifetime"}`. + # @!attribute [rw] favorite_count + # @return [::Integer] + # Favorite count in the source system. + class UsageSignal + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DataCatalog::V1::UsageStats] + class UsageWithinTimeRangeEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DataCatalog::V1::CommonUsageStats] + class CommonUsageWithinTimeRangeEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..4a392cc26e75 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..fb4d6862eac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..09acc69b6125 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..41c8c3a565cc --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/Gemfile new file mode 100644 index 000000000000..ddc6ae6ce746 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-data_catalog-v1", path: "../" +else + gem "google-cloud-data_catalog-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-data_catalog-v1/snippets/data_catalog/create_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry.rb new file mode 100644 index 000000000000..de6531135b4f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_CreateEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry. +# +def create_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateEntryRequest.new + + # Call the create_entry method. + result = client.create_entry request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end +# [END datacatalog_v1_generated_DataCatalog_CreateEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb new file mode 100644 index 000000000000..9e03d34725fd --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_CreateEntryGroup_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_entry_group call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry_group. +# +def create_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new + + # Call the create_entry_group method. + result = client.create_entry_group request + + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + p result +end +# [END datacatalog_v1_generated_DataCatalog_CreateEntryGroup_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb new file mode 100644 index 000000000000..0f286306b587 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_CreateTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_tag call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag. +# +def create_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTagRequest.new + + # Call the create_tag method. + result = client.create_tag request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + p result +end +# [END datacatalog_v1_generated_DataCatalog_CreateTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb new file mode 100644 index 000000000000..4192b00e5a73 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_CreateTagTemplate_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_tag_template call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template. +# +def create_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new + + # Call the create_tag_template method. + result = client.create_tag_template request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + p result +end +# [END datacatalog_v1_generated_DataCatalog_CreateTagTemplate_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb new file mode 100644 index 000000000000..3c2bc6b72a92 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_CreateTagTemplateField_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_tag_template_field call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template_field. +# +def create_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new + + # Call the create_tag_template_field method. + result = client.create_tag_template_field request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end +# [END datacatalog_v1_generated_DataCatalog_CreateTagTemplateField_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb new file mode 100644 index 000000000000..450950bef84f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_DeleteEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry. +# +def delete_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new + + # Call the delete_entry method. + result = client.delete_entry request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_DataCatalog_DeleteEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb new file mode 100644 index 000000000000..d3c2f448b548 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_DeleteEntryGroup_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_entry_group call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry_group. +# +def delete_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new + + # Call the delete_entry_group method. + result = client.delete_entry_group request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_DataCatalog_DeleteEntryGroup_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb new file mode 100644 index 000000000000..267499a053e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_DeleteTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_tag call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag. +# +def delete_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTagRequest.new + + # Call the delete_tag method. + result = client.delete_tag request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_DataCatalog_DeleteTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb new file mode 100644 index 000000000000..88517b92ddff --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_DeleteTagTemplate_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_tag_template call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template. +# +def delete_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new + + # Call the delete_tag_template method. + result = client.delete_tag_template request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_DataCatalog_DeleteTagTemplate_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb new file mode 100644 index 000000000000..097bc657a5da --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_DeleteTagTemplateField_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_tag_template_field call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template_field. +# +def delete_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new + + # Call the delete_tag_template_field method. + result = client.delete_tag_template_field request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_DataCatalog_DeleteTagTemplateField_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb new file mode 100644 index 000000000000..871edeb05999 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_GetEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry. +# +def get_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetEntryRequest.new + + # Call the get_entry method. + result = client.get_entry request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end +# [END datacatalog_v1_generated_DataCatalog_GetEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb new file mode 100644 index 000000000000..a990aecf2627 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_GetEntryGroup_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_entry_group call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry_group. +# +def get_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new + + # Call the get_entry_group method. + result = client.get_entry_group request + + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + p result +end +# [END datacatalog_v1_generated_DataCatalog_GetEntryGroup_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb new file mode 100644 index 000000000000..954098e772ba --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_GetIamPolicy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_iam_policy call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END datacatalog_v1_generated_DataCatalog_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb new file mode 100644 index 000000000000..7b40c0940a60 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_GetTagTemplate_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_tag_template call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_tag_template. +# +def get_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new + + # Call the get_tag_template method. + result = client.get_tag_template request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + p result +end +# [END datacatalog_v1_generated_DataCatalog_GetTagTemplate_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/import_entries.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/import_entries.rb new file mode 100644 index 000000000000..c9352c7abb19 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/import_entries.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ImportEntries_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the import_entries call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#import_entries. +# +def import_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new + + # Call the import_entries method. + result = client.import_entries request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END datacatalog_v1_generated_DataCatalog_ImportEntries_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb new file mode 100644 index 000000000000..4801e7671777 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ListEntries_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the list_entries call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entries. +# +def list_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListEntriesRequest.new + + # Call the list_entries method. + result = client.list_entries request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry. + p item + end +end +# [END datacatalog_v1_generated_DataCatalog_ListEntries_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb new file mode 100644 index 000000000000..d7402c2f11b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ListEntryGroups_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the list_entry_groups call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entry_groups. +# +def list_entry_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.new + + # Call the list_entry_groups method. + result = client.list_entry_groups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup. + p item + end +end +# [END datacatalog_v1_generated_DataCatalog_ListEntryGroups_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb new file mode 100644 index 000000000000..53f58010039b --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ListTags_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the list_tags call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags. +# +def list_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListTagsRequest.new + + # Call the list_tags method. + result = client.list_tags request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag. + p item + end +end +# [END datacatalog_v1_generated_DataCatalog_ListTags_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb new file mode 100644 index 000000000000..3a902c125026 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_LookupEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the lookup_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#lookup_entry. +# +def lookup_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::LookupEntryRequest.new + + # Call the lookup_entry method. + result = client.lookup_entry request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end +# [END datacatalog_v1_generated_DataCatalog_LookupEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb new file mode 100644 index 000000000000..eea2874dee93 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ModifyEntryContacts_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the modify_entry_contacts call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_contacts. +# +def modify_entry_contacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new + + # Call the modify_entry_contacts method. + result = client.modify_entry_contacts request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Contacts. + p result +end +# [END datacatalog_v1_generated_DataCatalog_ModifyEntryContacts_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb new file mode 100644 index 000000000000..6aa2fadb42e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ModifyEntryOverview_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the modify_entry_overview call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_overview. +# +def modify_entry_overview + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new + + # Call the modify_entry_overview method. + result = client.modify_entry_overview request + + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryOverview. + p result +end +# [END datacatalog_v1_generated_DataCatalog_ModifyEntryOverview_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/reconcile_tags.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/reconcile_tags.rb new file mode 100644 index 000000000000..231dfcc9c62a --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/reconcile_tags.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_ReconcileTags_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the reconcile_tags call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#reconcile_tags. +# +def reconcile_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new + + # Call the reconcile_tags method. + result = client.reconcile_tags request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END datacatalog_v1_generated_DataCatalog_ReconcileTags_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb new file mode 100644 index 000000000000..d5f26a155262 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_RenameTagTemplateField_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the rename_tag_template_field call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field. +# +def rename_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new + + # Call the rename_tag_template_field method. + result = client.rename_tag_template_field request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end +# [END datacatalog_v1_generated_DataCatalog_RenameTagTemplateField_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb new file mode 100644 index 000000000000..5cab6c0f0508 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_RenameTagTemplateFieldEnumValue_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the rename_tag_template_field_enum_value call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field_enum_value. +# +def rename_tag_template_field_enum_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new + + # Call the rename_tag_template_field_enum_value method. + result = client.rename_tag_template_field_enum_value request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end +# [END datacatalog_v1_generated_DataCatalog_RenameTagTemplateFieldEnumValue_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/retrieve_config.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/retrieve_config.rb new file mode 100644 index 000000000000..84a9d212512e --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/retrieve_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_RetrieveConfig_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the retrieve_config call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_config. +# +def retrieve_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new + + # Call the retrieve_config method. + result = client.retrieve_config request + + # The returned object is of type Google::Cloud::DataCatalog::V1::OrganizationConfig. + p result +end +# [END datacatalog_v1_generated_DataCatalog_RetrieveConfig_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/retrieve_effective_config.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/retrieve_effective_config.rb new file mode 100644 index 000000000000..4a8ded22620a --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/retrieve_effective_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_RetrieveEffectiveConfig_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the retrieve_effective_config call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_effective_config. +# +def retrieve_effective_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new + + # Call the retrieve_effective_config method. + result = client.retrieve_effective_config request + + # The returned object is of type Google::Cloud::DataCatalog::V1::MigrationConfig. + p result +end +# [END datacatalog_v1_generated_DataCatalog_RetrieveEffectiveConfig_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb new file mode 100644 index 000000000000..731db803d9e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_SearchCatalog_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the search_catalog call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog. +# +def search_catalog + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new + + # Call the search_catalog method. + result = client.search_catalog request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult. + p item + end +end +# [END datacatalog_v1_generated_DataCatalog_SearchCatalog_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/set_config.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/set_config.rb new file mode 100644 index 000000000000..fd77b242af04 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/set_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_SetConfig_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the set_config call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_config. +# +def set_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::SetConfigRequest.new + + # Call the set_config method. + result = client.set_config request + + # The returned object is of type Google::Cloud::DataCatalog::V1::MigrationConfig. + p result +end +# [END datacatalog_v1_generated_DataCatalog_SetConfig_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb new file mode 100644 index 000000000000..ce80235bc6a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_SetIamPolicy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the set_iam_policy call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END datacatalog_v1_generated_DataCatalog_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb new file mode 100644 index 000000000000..d175d0ce89e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_StarEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the star_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#star_entry. +# +def star_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::StarEntryRequest.new + + # Call the star_entry method. + result = client.star_entry request + + # The returned object is of type Google::Cloud::DataCatalog::V1::StarEntryResponse. + p result +end +# [END datacatalog_v1_generated_DataCatalog_StarEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb new file mode 100644 index 000000000000..ce78b2f5c95f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_TestIamPermissions_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the test_iam_permissions call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END datacatalog_v1_generated_DataCatalog_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb new file mode 100644 index 000000000000..e09eb5e71337 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_UnstarEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the unstar_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#unstar_entry. +# +def unstar_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new + + # Call the unstar_entry method. + result = client.unstar_entry request + + # The returned object is of type Google::Cloud::DataCatalog::V1::UnstarEntryResponse. + p result +end +# [END datacatalog_v1_generated_DataCatalog_UnstarEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb new file mode 100644 index 000000000000..7874c7ef9c31 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_UpdateEntry_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_entry call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry. +# +def update_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new + + # Call the update_entry method. + result = client.update_entry request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end +# [END datacatalog_v1_generated_DataCatalog_UpdateEntry_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb new file mode 100644 index 000000000000..d10a3c268eaa --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_UpdateEntryGroup_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_entry_group call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry_group. +# +def update_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new + + # Call the update_entry_group method. + result = client.update_entry_group request + + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + p result +end +# [END datacatalog_v1_generated_DataCatalog_UpdateEntryGroup_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb new file mode 100644 index 000000000000..826d88e26dac --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_UpdateTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_tag call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag. +# +def update_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTagRequest.new + + # Call the update_tag method. + result = client.update_tag request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + p result +end +# [END datacatalog_v1_generated_DataCatalog_UpdateTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb new file mode 100644 index 000000000000..7bf02e335a88 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_UpdateTagTemplate_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_tag_template call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template. +# +def update_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new + + # Call the update_tag_template method. + result = client.update_tag_template request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + p result +end +# [END datacatalog_v1_generated_DataCatalog_UpdateTagTemplate_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb new file mode 100644 index 000000000000..41955563d5a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_DataCatalog_UpdateTagTemplateField_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_tag_template_field call in the DataCatalog service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template_field. +# +def update_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new + + # Call the update_tag_template_field method. + result = client.update_tag_template_field request + + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end +# [END datacatalog_v1_generated_DataCatalog_UpdateTagTemplateField_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb new file mode 100644 index 000000000000..6770169b4cb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_CreatePolicyTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_policy_tag call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_policy_tag. +# +def create_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new + + # Call the create_policy_tag method. + result = client.create_policy_tag request + + # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_CreatePolicyTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb new file mode 100644 index 000000000000..4f88857f1a09 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_CreateTaxonomy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the create_taxonomy call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_taxonomy. +# +def create_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new + + # Call the create_taxonomy method. + result = client.create_taxonomy request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_CreateTaxonomy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb new file mode 100644 index 000000000000..5323aee6b7d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_DeletePolicyTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_policy_tag call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_policy_tag. +# +def delete_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new + + # Call the delete_policy_tag method. + result = client.delete_policy_tag request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_DeletePolicyTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb new file mode 100644 index 000000000000..ef85ba8432d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_DeleteTaxonomy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the delete_taxonomy call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_taxonomy. +# +def delete_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new + + # Call the delete_taxonomy method. + result = client.delete_taxonomy request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_DeleteTaxonomy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb new file mode 100644 index 000000000000..60a8400a3c7a --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_GetIamPolicy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_iam_policy call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb new file mode 100644 index 000000000000..bd928cd31204 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_GetPolicyTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_policy_tag call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_policy_tag. +# +def get_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new + + # Call the get_policy_tag method. + result = client.get_policy_tag request + + # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_GetPolicyTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb new file mode 100644 index 000000000000..82340d344ef0 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_GetTaxonomy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the get_taxonomy call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_taxonomy. +# +def get_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new + + # Call the get_taxonomy method. + result = client.get_taxonomy request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_GetTaxonomy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb new file mode 100644 index 000000000000..e190d379981f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_ListPolicyTags_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the list_policy_tags call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_policy_tags. +# +def list_policy_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new + + # Call the list_policy_tags method. + result = client.list_policy_tags request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag. + p item + end +end +# [END datacatalog_v1_generated_PolicyTagManager_ListPolicyTags_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb new file mode 100644 index 000000000000..896065872ebb --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_ListTaxonomies_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the list_taxonomies call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_taxonomies. +# +def list_taxonomies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new + + # Call the list_taxonomies method. + result = client.list_taxonomies request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy. + p item + end +end +# [END datacatalog_v1_generated_PolicyTagManager_ListTaxonomies_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb new file mode 100644 index 000000000000..9807316f9c2f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_SetIamPolicy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the set_iam_policy call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb new file mode 100644 index 000000000000..66e7c80d69f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_TestIamPermissions_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the test_iam_permissions call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb new file mode 100644 index 000000000000..8cf93c38bb68 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_UpdatePolicyTag_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_policy_tag call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_policy_tag. +# +def update_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new + + # Call the update_policy_tag method. + result = client.update_policy_tag request + + # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_UpdatePolicyTag_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb new file mode 100644 index 000000000000..226dff5d67af --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManager_UpdateTaxonomy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the update_taxonomy call in the PolicyTagManager service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_taxonomy. +# +def update_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new + + # Call the update_taxonomy method. + result = client.update_taxonomy request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end +# [END datacatalog_v1_generated_PolicyTagManager_UpdateTaxonomy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb new file mode 100644 index 000000000000..74b19228ff25 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManagerSerialization_ExportTaxonomies_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the export_taxonomies call in the PolicyTagManagerSerialization service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#export_taxonomies. +# +def export_taxonomies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new + + # Call the export_taxonomies method. + result = client.export_taxonomies request + + # The returned object is of type Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse. + p result +end +# [END datacatalog_v1_generated_PolicyTagManagerSerialization_ExportTaxonomies_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb new file mode 100644 index 000000000000..a1681ef281b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManagerSerialization_ImportTaxonomies_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the import_taxonomies call in the PolicyTagManagerSerialization service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#import_taxonomies. +# +def import_taxonomies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new + + # Call the import_taxonomies method. + result = client.import_taxonomies request + + # The returned object is of type Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse. + p result +end +# [END datacatalog_v1_generated_PolicyTagManagerSerialization_ImportTaxonomies_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb new file mode 100644 index 000000000000..d882a5d61e81 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START datacatalog_v1_generated_PolicyTagManagerSerialization_ReplaceTaxonomy_sync] +require "google/cloud/data_catalog/v1" + +## +# Snippet for the replace_taxonomy call in the PolicyTagManagerSerialization service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#replace_taxonomy. +# +def replace_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new + + # Call the replace_taxonomy method. + result = client.replace_taxonomy request + + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end +# [END datacatalog_v1_generated_PolicyTagManagerSerialization_ReplaceTaxonomy_sync] diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json new file mode 100644 index 000000000000..2a580573254e --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json @@ -0,0 +1,2135 @@ +{ + "client_library": { + "name": "google-cloud-data_catalog-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.datacatalog.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "datacatalog_v1_generated_DataCatalog_SearchCatalog_sync", + "title": "Snippet for the search_catalog call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog.", + "file": "data_catalog/search_catalog.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_catalog", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::SearchCatalogRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::SearchCatalogResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "SearchCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.SearchCatalog", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_CreateEntryGroup_sync", + "title": "Snippet for the create_entry_group call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry_group.", + "file": "data_catalog/create_entry_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_entry_group", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::EntryGroup", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "CreateEntryGroup", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.CreateEntryGroup", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_GetEntryGroup_sync", + "title": "Snippet for the get_entry_group call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry_group.", + "file": "data_catalog/get_entry_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_entry_group", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::EntryGroup", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "GetEntryGroup", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.GetEntryGroup", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_UpdateEntryGroup_sync", + "title": "Snippet for the update_entry_group call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry_group.", + "file": "data_catalog/update_entry_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_entry_group", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::EntryGroup", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "UpdateEntryGroup", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.UpdateEntryGroup", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_DeleteEntryGroup_sync", + "title": "Snippet for the delete_entry_group call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry_group.", + "file": "data_catalog/delete_entry_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_entry_group", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "DeleteEntryGroup", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.DeleteEntryGroup", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ListEntryGroups_sync", + "title": "Snippet for the list_entry_groups call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entry_groups.", + "file": "data_catalog/list_entry_groups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_entry_groups", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entry_groups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ListEntryGroups", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_CreateEntry_sync", + "title": "Snippet for the create_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry.", + "file": "data_catalog/create_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreateEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Entry", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "CreateEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.CreateEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_UpdateEntry_sync", + "title": "Snippet for the update_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry.", + "file": "data_catalog/update_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdateEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Entry", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "UpdateEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.UpdateEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_DeleteEntry_sync", + "title": "Snippet for the delete_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry.", + "file": "data_catalog/delete_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeleteEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "DeleteEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.DeleteEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_GetEntry_sync", + "title": "Snippet for the get_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry.", + "file": "data_catalog/get_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::GetEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Entry", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "GetEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.GetEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_LookupEntry_sync", + "title": "Snippet for the lookup_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#lookup_entry.", + "file": "data_catalog/lookup_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "lookup_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#lookup_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::LookupEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Entry", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "LookupEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.LookupEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ListEntries_sync", + "title": "Snippet for the list_entries call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entries.", + "file": "data_catalog/list_entries.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_entries", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entries", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ListEntriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ListEntriesResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ListEntries", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ListEntries", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ModifyEntryOverview_sync", + "title": "Snippet for the modify_entry_overview call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_overview.", + "file": "data_catalog/modify_entry_overview.rb", + "language": "RUBY", + "client_method": { + "short_name": "modify_entry_overview", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_overview", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::EntryOverview", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ModifyEntryOverview", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ModifyEntryOverview", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ModifyEntryContacts_sync", + "title": "Snippet for the modify_entry_contacts call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_contacts.", + "file": "data_catalog/modify_entry_contacts.rb", + "language": "RUBY", + "client_method": { + "short_name": "modify_entry_contacts", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_contacts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Contacts", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ModifyEntryContacts", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ModifyEntryContacts", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_CreateTagTemplate_sync", + "title": "Snippet for the create_tag_template call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template.", + "file": "data_catalog/create_tag_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag_template", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplate", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "CreateTagTemplate", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplate", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_GetTagTemplate_sync", + "title": "Snippet for the get_tag_template call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_tag_template.", + "file": "data_catalog/get_tag_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tag_template", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_tag_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplate", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "GetTagTemplate", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.GetTagTemplate", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_UpdateTagTemplate_sync", + "title": "Snippet for the update_tag_template call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template.", + "file": "data_catalog/update_tag_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tag_template", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplate", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "UpdateTagTemplate", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplate", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_DeleteTagTemplate_sync", + "title": "Snippet for the delete_tag_template call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template.", + "file": "data_catalog/delete_tag_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag_template", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "DeleteTagTemplate", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplate", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_CreateTagTemplateField_sync", + "title": "Snippet for the create_tag_template_field call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template_field.", + "file": "data_catalog/create_tag_template_field.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag_template_field", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template_field", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplateField", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "CreateTagTemplateField", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplateField", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_UpdateTagTemplateField_sync", + "title": "Snippet for the update_tag_template_field call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template_field.", + "file": "data_catalog/update_tag_template_field.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tag_template_field", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template_field", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplateField", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "UpdateTagTemplateField", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplateField", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_RenameTagTemplateField_sync", + "title": "Snippet for the rename_tag_template_field call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field.", + "file": "data_catalog/rename_tag_template_field.rb", + "language": "RUBY", + "client_method": { + "short_name": "rename_tag_template_field", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplateField", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "RenameTagTemplateField", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateField", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_RenameTagTemplateFieldEnumValue_sync", + "title": "Snippet for the rename_tag_template_field_enum_value call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field_enum_value.", + "file": "data_catalog/rename_tag_template_field_enum_value.rb", + "language": "RUBY", + "client_method": { + "short_name": "rename_tag_template_field_enum_value", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field_enum_value", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::TagTemplateField", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "RenameTagTemplateFieldEnumValue", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValue", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_DeleteTagTemplateField_sync", + "title": "Snippet for the delete_tag_template_field call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template_field.", + "file": "data_catalog/delete_tag_template_field.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag_template_field", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template_field", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "DeleteTagTemplateField", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplateField", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_CreateTag_sync", + "title": "Snippet for the create_tag call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag.", + "file": "data_catalog/create_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreateTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Tag", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "CreateTag", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.CreateTag", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_UpdateTag_sync", + "title": "Snippet for the update_tag call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag.", + "file": "data_catalog/update_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdateTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Tag", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "UpdateTag", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.UpdateTag", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_DeleteTag_sync", + "title": "Snippet for the delete_tag call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag.", + "file": "data_catalog/delete_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeleteTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "DeleteTag", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.DeleteTag", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ListTags_sync", + "title": "Snippet for the list_tags call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags.", + "file": "data_catalog/list_tags.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tags", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ListTagsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ListTagsResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ListTags", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ListTags", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ReconcileTags_sync", + "title": "Snippet for the reconcile_tags call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#reconcile_tags.", + "file": "data_catalog/reconcile_tags.rb", + "language": "RUBY", + "client_method": { + "short_name": "reconcile_tags", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#reconcile_tags", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ReconcileTags", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ReconcileTags", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_StarEntry_sync", + "title": "Snippet for the star_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#star_entry.", + "file": "data_catalog/star_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "star_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#star_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::StarEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::StarEntryResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "StarEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.StarEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_UnstarEntry_sync", + "title": "Snippet for the unstar_entry call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#unstar_entry.", + "file": "data_catalog/unstar_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "unstar_entry", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#unstar_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UnstarEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::UnstarEntryResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "UnstarEntry", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.UnstarEntry", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_iam_policy.", + "file": "data_catalog/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.SetIamPolicy", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_iam_policy.", + "file": "data_catalog/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.GetIamPolicy", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#test_iam_permissions.", + "file": "data_catalog/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.TestIamPermissions", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_ImportEntries_sync", + "title": "Snippet for the import_entries call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#import_entries.", + "file": "data_catalog/import_entries.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_entries", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#import_entries", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ImportEntriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "ImportEntries", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.ImportEntries", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_SetConfig_sync", + "title": "Snippet for the set_config call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_config.", + "file": "data_catalog/set_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_config", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::SetConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::MigrationConfig", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "SetConfig", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.SetConfig", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_RetrieveConfig_sync", + "title": "Snippet for the retrieve_config call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_config.", + "file": "data_catalog/retrieve_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "retrieve_config", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::OrganizationConfig", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "RetrieveConfig", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.RetrieveConfig", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_DataCatalog_RetrieveEffectiveConfig_sync", + "title": "Snippet for the retrieve_effective_config call in the DataCatalog service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_effective_config.", + "file": "data_catalog/retrieve_effective_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "retrieve_effective_config", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client#retrieve_effective_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::MigrationConfig", + "client": { + "short_name": "DataCatalog::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::DataCatalog::Client" + }, + "method": { + "short_name": "RetrieveEffectiveConfig", + "full_name": "google.cloud.datacatalog.v1.DataCatalog.RetrieveEffectiveConfig", + "service": { + "short_name": "DataCatalog", + "full_name": "google.cloud.datacatalog.v1.DataCatalog" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_CreateTaxonomy_sync", + "title": "Snippet for the create_taxonomy call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_taxonomy.", + "file": "policy_tag_manager/create_taxonomy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_taxonomy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_taxonomy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Taxonomy", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "CreateTaxonomy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomy", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_DeleteTaxonomy_sync", + "title": "Snippet for the delete_taxonomy call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_taxonomy.", + "file": "policy_tag_manager/delete_taxonomy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_taxonomy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_taxonomy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "DeleteTaxonomy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomy", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_UpdateTaxonomy_sync", + "title": "Snippet for the update_taxonomy call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_taxonomy.", + "file": "policy_tag_manager/update_taxonomy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_taxonomy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_taxonomy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Taxonomy", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "UpdateTaxonomy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomy", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_ListTaxonomies_sync", + "title": "Snippet for the list_taxonomies call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_taxonomies.", + "file": "policy_tag_manager/list_taxonomies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_taxonomies", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_taxonomies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "ListTaxonomies", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_GetTaxonomy_sync", + "title": "Snippet for the get_taxonomy call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_taxonomy.", + "file": "policy_tag_manager/get_taxonomy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_taxonomy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_taxonomy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Taxonomy", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "GetTaxonomy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomy", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_CreatePolicyTag_sync", + "title": "Snippet for the create_policy_tag call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_policy_tag.", + "file": "policy_tag_manager/create_policy_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_policy_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_policy_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::PolicyTag", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "CreatePolicyTag", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTag", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_DeletePolicyTag_sync", + "title": "Snippet for the delete_policy_tag call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_policy_tag.", + "file": "policy_tag_manager/delete_policy_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_policy_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_policy_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "DeletePolicyTag", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTag", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_UpdatePolicyTag_sync", + "title": "Snippet for the update_policy_tag call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_policy_tag.", + "file": "policy_tag_manager/update_policy_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_policy_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_policy_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::PolicyTag", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "UpdatePolicyTag", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTag", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_ListPolicyTags_sync", + "title": "Snippet for the list_policy_tags call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_policy_tags.", + "file": "policy_tag_manager/list_policy_tags.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_policy_tags", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_policy_tags", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "ListPolicyTags", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_GetPolicyTag_sync", + "title": "Snippet for the get_policy_tag call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_policy_tag.", + "file": "policy_tag_manager/get_policy_tag.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_policy_tag", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_policy_tag", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::PolicyTag", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "GetPolicyTag", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTag", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_iam_policy.", + "file": "policy_tag_manager/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.GetIamPolicy", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#set_iam_policy.", + "file": "policy_tag_manager/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.SetIamPolicy", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManager_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the PolicyTagManager service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#test_iam_permissions.", + "file": "policy_tag_manager/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "PolicyTagManager::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager.TestIamPermissions", + "service": { + "short_name": "PolicyTagManager", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManagerSerialization_ReplaceTaxonomy_sync", + "title": "Snippet for the replace_taxonomy call in the PolicyTagManagerSerialization service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#replace_taxonomy.", + "file": "policy_tag_manager_serialization/replace_taxonomy.rb", + "language": "RUBY", + "client_method": { + "short_name": "replace_taxonomy", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#replace_taxonomy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::Taxonomy", + "client": { + "short_name": "PolicyTagManagerSerialization::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client" + }, + "method": { + "short_name": "ReplaceTaxonomy", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ReplaceTaxonomy", + "service": { + "short_name": "PolicyTagManagerSerialization", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManagerSerialization" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManagerSerialization_ImportTaxonomies_sync", + "title": "Snippet for the import_taxonomies call in the PolicyTagManagerSerialization service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#import_taxonomies.", + "file": "policy_tag_manager_serialization/import_taxonomies.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_taxonomies", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#import_taxonomies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse", + "client": { + "short_name": "PolicyTagManagerSerialization::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client" + }, + "method": { + "short_name": "ImportTaxonomies", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies", + "service": { + "short_name": "PolicyTagManagerSerialization", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManagerSerialization" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "datacatalog_v1_generated_PolicyTagManagerSerialization_ExportTaxonomies_sync", + "title": "Snippet for the export_taxonomies call in the PolicyTagManagerSerialization service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#export_taxonomies.", + "file": "policy_tag_manager_serialization/export_taxonomies.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_taxonomies", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#export_taxonomies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse", + "client": { + "short_name": "PolicyTagManagerSerialization::Client", + "full_name": "::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client" + }, + "method": { + "short_name": "ExportTaxonomies", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies", + "service": { + "short_name": "PolicyTagManagerSerialization", + "full_name": "google.cloud.datacatalog.v1.PolicyTagManagerSerialization" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb new file mode 100644 index 000000000000..a8fd8380812c --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_operations_test.rb @@ -0,0 +1,398 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/datacatalog/v1/datacatalog_pb" +require "google/cloud/datacatalog/v1/datacatalog_services_pb" +require "google/cloud/data_catalog/v1/data_catalog" + +class ::Google::Cloud::DataCatalog::V1::DataCatalog::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb new file mode 100644 index 000000000000..d6bc9c2af2b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_paths_test.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/data_catalog/v1/data_catalog" + +class ::Google::Cloud::DataCatalog::V1::DataCatalog::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_entry_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entry_path project: "value0", location: "value1", entry_group: "value2", entry: "value3" + assert_equal "projects/value0/locations/value1/entryGroups/value2/entries/value3", path + end + end + + def test_entry_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entry_group_path project: "value0", location: "value1", entry_group: "value2" + assert_equal "projects/value0/locations/value1/entryGroups/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::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_tag_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_path project: "value0", location: "value1", entry_group: "value2", entry: "value3", tag: "value4" + assert_equal "projects/value0/locations/value1/entryGroups/value2/entries/value3/tags/value4", path + end + end + + def test_tag_template_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_template_path project: "value0", location: "value1", tag_template: "value2" + assert_equal "projects/value0/locations/value1/tagTemplates/value2", path + end + end + + def test_tag_template_field_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_template_field_path project: "value0", location: "value1", tag_template: "value2", field: "value3" + assert_equal "projects/value0/locations/value1/tagTemplates/value2/fields/value3", path + end + end + + def test_tag_template_field_enum_value_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tag_template_field_enum_value_path project: "value0", location: "value1", tag_template: "value2", tag_template_field_id: "value3", enum_value_display_name: "value4" + assert_equal "projects/value0/locations/value1/tagTemplates/value2/fields/value3/enumValues/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb new file mode 100644 index 000000000000..d0a036d0c6bf --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_rest_test.rb @@ -0,0 +1,2144 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/datacatalog/v1/datacatalog_pb" +require "google/cloud/data_catalog/v1/data_catalog/rest" + + +class ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_search_catalog + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::SearchCatalogResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + scope = {} + query = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + admin_search = true + + search_catalog_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_search_catalog_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_catalog_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_catalog({ scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_catalog scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_catalog ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new(scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_catalog({ scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_catalog(::Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new(scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_catalog_client_stub.call_count + end + end + end + + def test_create_entry_group + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::EntryGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + entry_group_id = "hello world" + entry_group = {} + + create_entry_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_create_entry_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_entry_group({ parent: parent, entry_group_id: entry_group_id, entry_group: entry_group }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_entry_group parent: parent, entry_group_id: entry_group_id, entry_group: entry_group do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_entry_group ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new(parent: parent, entry_group_id: entry_group_id, entry_group: entry_group) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_entry_group({ parent: parent, entry_group_id: entry_group_id, entry_group: entry_group }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_entry_group(::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new(parent: parent, entry_group_id: entry_group_id, entry_group: entry_group), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_entry_group_client_stub.call_count + end + end + end + + def test_get_entry_group + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::EntryGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + read_mask = {} + + get_entry_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_get_entry_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_entry_group({ name: name, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_entry_group name: name, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_entry_group ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new(name: name, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_entry_group({ name: name, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_entry_group(::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new(name: name, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_entry_group_client_stub.call_count + end + end + end + + def test_update_entry_group + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::EntryGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + entry_group = {} + update_mask = {} + + update_entry_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_update_entry_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_entry_group({ entry_group: entry_group, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_entry_group entry_group: entry_group, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_entry_group ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new(entry_group: entry_group, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_entry_group({ entry_group: entry_group, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_entry_group(::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new(entry_group: entry_group, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_entry_group_client_stub.call_count + end + end + end + + def test_delete_entry_group + # 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" + force = true + + delete_entry_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_delete_entry_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_entry_group({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_entry_group name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_entry_group ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_entry_group({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_entry_group(::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_entry_group_client_stub.call_count + end + end + end + + def test_list_entry_groups + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse.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_entry_groups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_list_entry_groups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_entry_groups_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_entry_groups({ 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_entry_groups 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_entry_groups ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.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_entry_groups({ 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_entry_groups(::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.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_entry_groups_client_stub.call_count + end + end + end + + def test_create_entry + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Entry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + entry_id = "hello world" + entry = {} + + create_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_create_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_entry({ parent: parent, entry_id: entry_id, entry: entry }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_entry parent: parent, entry_id: entry_id, entry: entry do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_entry ::Google::Cloud::DataCatalog::V1::CreateEntryRequest.new(parent: parent, entry_id: entry_id, entry: entry) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_entry({ parent: parent, entry_id: entry_id, entry: entry }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_entry(::Google::Cloud::DataCatalog::V1::CreateEntryRequest.new(parent: parent, entry_id: entry_id, entry: entry), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_entry_client_stub.call_count + end + end + end + + def test_update_entry + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Entry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + entry = {} + update_mask = {} + + update_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_update_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_entry({ entry: entry, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_entry entry: entry, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_entry ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new(entry: entry, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_entry({ entry: entry, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_entry(::Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new(entry: entry, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_entry_client_stub.call_count + end + end + end + + def test_delete_entry + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_delete_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_entry({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_entry name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_entry ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_entry({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_entry(::Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_entry_client_stub.call_count + end + end + end + + def test_get_entry + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Entry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_get_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_entry({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_entry name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_entry ::Google::Cloud::DataCatalog::V1::GetEntryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_entry({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_entry(::Google::Cloud::DataCatalog::V1::GetEntryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_entry_client_stub.call_count + end + end + end + + def test_lookup_entry + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Entry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + linked_resource = "hello world" + project = "hello world" + location = "hello world" + + lookup_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_lookup_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, lookup_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.lookup_entry({ linked_resource: linked_resource, project: project, location: location }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.lookup_entry linked_resource: linked_resource, project: project, location: location do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.lookup_entry ::Google::Cloud::DataCatalog::V1::LookupEntryRequest.new(linked_resource: linked_resource, project: project, location: location) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.lookup_entry({ linked_resource: linked_resource, project: project, location: location }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.lookup_entry(::Google::Cloud::DataCatalog::V1::LookupEntryRequest.new(linked_resource: linked_resource, project: project, location: location), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, lookup_entry_client_stub.call_count + end + end + end + + def test_list_entries + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ListEntriesResponse.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" + read_mask = {} + + list_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_list_entries_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_entries_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_entries({ parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_entries parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_entries ::Google::Cloud::DataCatalog::V1::ListEntriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_entries({ parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_entries(::Google::Cloud::DataCatalog::V1::ListEntriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_entries_client_stub.call_count + end + end + end + + def test_modify_entry_overview + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::EntryOverview.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + entry_overview = {} + + modify_entry_overview_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_modify_entry_overview_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, modify_entry_overview_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.modify_entry_overview({ name: name, entry_overview: entry_overview }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.modify_entry_overview name: name, entry_overview: entry_overview do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.modify_entry_overview ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new(name: name, entry_overview: entry_overview) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.modify_entry_overview({ name: name, entry_overview: entry_overview }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.modify_entry_overview(::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new(name: name, entry_overview: entry_overview), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, modify_entry_overview_client_stub.call_count + end + end + end + + def test_modify_entry_contacts + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Contacts.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + contacts = {} + + modify_entry_contacts_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_modify_entry_contacts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, modify_entry_contacts_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.modify_entry_contacts({ name: name, contacts: contacts }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.modify_entry_contacts name: name, contacts: contacts do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.modify_entry_contacts ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new(name: name, contacts: contacts) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.modify_entry_contacts({ name: name, contacts: contacts }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.modify_entry_contacts(::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new(name: name, contacts: contacts), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, modify_entry_contacts_client_stub.call_count + end + end + end + + def test_create_tag_template + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag_template_id = "hello world" + tag_template = {} + + create_tag_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_create_tag_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag_template({ parent: parent, tag_template_id: tag_template_id, tag_template: tag_template }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag_template parent: parent, tag_template_id: tag_template_id, tag_template: tag_template do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag_template ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new(parent: parent, tag_template_id: tag_template_id, tag_template: tag_template) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag_template({ parent: parent, tag_template_id: tag_template_id, tag_template: tag_template }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tag_template(::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new(parent: parent, tag_template_id: tag_template_id, tag_template: tag_template), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tag_template_client_stub.call_count + end + end + end + + def test_get_tag_template + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tag_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_get_tag_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tag_template({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tag_template name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tag_template ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tag_template({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tag_template(::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tag_template_client_stub.call_count + end + end + end + + def test_update_tag_template + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tag_template = {} + update_mask = {} + + update_tag_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_update_tag_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tag_template({ tag_template: tag_template, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tag_template tag_template: tag_template, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tag_template ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new(tag_template: tag_template, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tag_template({ tag_template: tag_template, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tag_template(::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new(tag_template: tag_template, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tag_template_client_stub.call_count + end + end + end + + def test_delete_tag_template + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + delete_tag_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_delete_tag_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag_template({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag_template name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag_template ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag_template({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag_template(::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_template_client_stub.call_count + end + end + end + + def test_create_tag_template_field + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag_template_field_id = "hello world" + tag_template_field = {} + + create_tag_template_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_create_tag_template_field_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag_template_field({ parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag_template_field parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag_template_field ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new(parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag_template_field({ parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tag_template_field(::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new(parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tag_template_field_client_stub.call_count + end + end + end + + def test_update_tag_template_field + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + tag_template_field = {} + update_mask = {} + + update_tag_template_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_update_tag_template_field_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tag_template_field({ name: name, tag_template_field: tag_template_field, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tag_template_field name: name, tag_template_field: tag_template_field, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tag_template_field ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new(name: name, tag_template_field: tag_template_field, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tag_template_field({ name: name, tag_template_field: tag_template_field, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tag_template_field(::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new(name: name, tag_template_field: tag_template_field, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tag_template_field_client_stub.call_count + end + end + end + + def test_rename_tag_template_field + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + new_tag_template_field_id = "hello world" + + rename_tag_template_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_rename_tag_template_field_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rename_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rename_tag_template_field({ name: name, new_tag_template_field_id: new_tag_template_field_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rename_tag_template_field name: name, new_tag_template_field_id: new_tag_template_field_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rename_tag_template_field ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new(name: name, new_tag_template_field_id: new_tag_template_field_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rename_tag_template_field({ name: name, new_tag_template_field_id: new_tag_template_field_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rename_tag_template_field(::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new(name: name, new_tag_template_field_id: new_tag_template_field_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rename_tag_template_field_client_stub.call_count + end + end + end + + def test_rename_tag_template_field_enum_value + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + new_enum_value_display_name = "hello world" + + rename_tag_template_field_enum_value_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_rename_tag_template_field_enum_value_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rename_tag_template_field_enum_value_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rename_tag_template_field_enum_value({ name: name, new_enum_value_display_name: new_enum_value_display_name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rename_tag_template_field_enum_value name: name, new_enum_value_display_name: new_enum_value_display_name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rename_tag_template_field_enum_value ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new(name: name, new_enum_value_display_name: new_enum_value_display_name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rename_tag_template_field_enum_value({ name: name, new_enum_value_display_name: new_enum_value_display_name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rename_tag_template_field_enum_value(::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new(name: name, new_enum_value_display_name: new_enum_value_display_name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rename_tag_template_field_enum_value_client_stub.call_count + end + end + end + + def test_delete_tag_template_field + # 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" + force = true + + delete_tag_template_field_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_delete_tag_template_field_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag_template_field({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag_template_field name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag_template_field ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag_template_field({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag_template_field(::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_template_field_client_stub.call_count + end + end + end + + def test_create_tag + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Tag.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag = {} + + create_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_create_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tag({ parent: parent, tag: tag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tag parent: parent, tag: tag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tag ::Google::Cloud::DataCatalog::V1::CreateTagRequest.new(parent: parent, tag: tag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tag({ parent: parent, tag: tag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tag(::Google::Cloud::DataCatalog::V1::CreateTagRequest.new(parent: parent, tag: tag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tag_client_stub.call_count + end + end + end + + def test_update_tag + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Tag.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tag = {} + update_mask = {} + + update_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_update_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tag({ tag: tag, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tag tag: tag, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tag ::Google::Cloud::DataCatalog::V1::UpdateTagRequest.new(tag: tag, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tag({ tag: tag, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tag(::Google::Cloud::DataCatalog::V1::UpdateTagRequest.new(tag: tag, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tag_client_stub.call_count + end + end + end + + def test_delete_tag + # 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_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_delete_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tag({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tag name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tag ::Google::Cloud::DataCatalog::V1::DeleteTagRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tag({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tag(::Google::Cloud::DataCatalog::V1::DeleteTagRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tag_client_stub.call_count + end + end + end + + def test_list_tags + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ListTagsResponse.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_tags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_list_tags_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tags_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tags({ 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_tags 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_tags ::Google::Cloud::DataCatalog::V1::ListTagsRequest.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_tags({ 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_tags(::Google::Cloud::DataCatalog::V1::ListTagsRequest.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_tags_client_stub.call_count + end + end + end + + def test_reconcile_tags + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag_template = "hello world" + force_delete_missing = true + tags = [{}] + + reconcile_tags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_reconcile_tags_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reconcile_tags_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reconcile_tags({ parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reconcile_tags parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reconcile_tags ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new(parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reconcile_tags({ parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reconcile_tags(::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new(parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reconcile_tags_client_stub.call_count + end + end + end + + def test_star_entry + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::StarEntryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + star_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_star_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, star_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.star_entry({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.star_entry name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.star_entry ::Google::Cloud::DataCatalog::V1::StarEntryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.star_entry({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.star_entry(::Google::Cloud::DataCatalog::V1::StarEntryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, star_entry_client_stub.call_count + end + end + end + + def test_unstar_entry + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + unstar_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_unstar_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, unstar_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.unstar_entry({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.unstar_entry name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.unstar_entry ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.unstar_entry({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.unstar_entry(::Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, unstar_entry_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_import_entries + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + gcs_bucket_path = "hello world" + job_id = "hello world" + + import_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_import_entries_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_entries_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_entries({ parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_entries parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_entries ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new(parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_entries({ parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_entries(::Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new(parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_entries_client_stub.call_count + end + end + end + + def test_set_config + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::MigrationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + tag_template_migration = :TAG_TEMPLATE_MIGRATION_UNSPECIFIED + + set_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_set_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_config_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_config({ name: name, tag_template_migration: tag_template_migration }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_config name: name, tag_template_migration: tag_template_migration do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_config ::Google::Cloud::DataCatalog::V1::SetConfigRequest.new(name: name, tag_template_migration: tag_template_migration) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_config({ name: name, tag_template_migration: tag_template_migration }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_config(::Google::Cloud::DataCatalog::V1::SetConfigRequest.new(name: name, tag_template_migration: tag_template_migration), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_config_client_stub.call_count + end + end + end + + def test_retrieve_config + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::OrganizationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + retrieve_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_retrieve_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, retrieve_config_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.retrieve_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.retrieve_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.retrieve_config ::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.retrieve_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.retrieve_config(::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, retrieve_config_client_stub.call_count + end + end + end + + def test_retrieve_effective_config + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::MigrationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + retrieve_effective_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::ServiceStub.stub :transcode_retrieve_effective_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, retrieve_effective_config_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.retrieve_effective_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.retrieve_effective_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.retrieve_effective_config ::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.retrieve_effective_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.retrieve_effective_config(::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, retrieve_effective_config_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::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::DataCatalog::V1::DataCatalog::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb new file mode 100644 index 000000000000..6451555863d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/data_catalog_test.rb @@ -0,0 +1,2372 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/datacatalog/v1/datacatalog_pb" +require "google/cloud/datacatalog/v1/datacatalog_services_pb" +require "google/cloud/data_catalog/v1/data_catalog" + +class ::Google::Cloud::DataCatalog::V1::DataCatalog::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_search_catalog + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::SearchCatalogResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + scope = {} + query = "hello world" + page_size = 42 + page_token = "hello world" + order_by = "hello world" + admin_search = true + + search_catalog_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_catalog, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest::Scope), request["scope"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal true, request["admin_search"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_catalog_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_catalog({ scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_catalog scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_catalog ::Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new(scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_catalog({ scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_catalog(::Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new(scope: scope, query: query, page_size: page_size, page_token: page_token, order_by: order_by, admin_search: admin_search), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_catalog_client_stub.call_rpc_count + end + end + + def test_create_entry_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::EntryGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + entry_group_id = "hello world" + entry_group = {} + + create_entry_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_entry_group, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["entry_group_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::EntryGroup), request["entry_group"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_entry_group({ parent: parent, entry_group_id: entry_group_id, entry_group: entry_group }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_entry_group parent: parent, entry_group_id: entry_group_id, entry_group: entry_group do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_entry_group ::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new(parent: parent, entry_group_id: entry_group_id, entry_group: entry_group) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_entry_group({ parent: parent, entry_group_id: entry_group_id, entry_group: entry_group }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_entry_group(::Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new(parent: parent, entry_group_id: entry_group_id, entry_group: entry_group), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_entry_group_client_stub.call_rpc_count + end + end + + def test_get_entry_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::EntryGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + read_mask = {} + + get_entry_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_entry_group, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_entry_group({ name: name, read_mask: read_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_entry_group name: name, read_mask: read_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_entry_group ::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new(name: name, read_mask: read_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_entry_group({ name: name, read_mask: read_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_entry_group(::Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new(name: name, read_mask: read_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_entry_group_client_stub.call_rpc_count + end + end + + def test_update_entry_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::EntryGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + entry_group = {} + update_mask = {} + + update_entry_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_entry_group, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::EntryGroup), request["entry_group"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_entry_group({ entry_group: entry_group, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_entry_group entry_group: entry_group, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_entry_group ::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new(entry_group: entry_group, 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_entry_group({ entry_group: entry_group, 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_entry_group(::Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new(entry_group: entry_group, 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_entry_group_client_stub.call_rpc_count + end + end + + def test_delete_entry_group + # 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" + force = true + + delete_entry_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_entry_group, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_entry_group_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_entry_group({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_entry_group name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_entry_group ::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_entry_group({ name: name, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_entry_group(::Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_entry_group_client_stub.call_rpc_count + end + end + + def test_list_entry_groups + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ListEntryGroupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_entry_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_entry_groups, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest, 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_entry_groups_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_entry_groups({ 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_entry_groups 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_entry_groups ::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.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_entry_groups({ 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_entry_groups(::Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.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_entry_groups_client_stub.call_rpc_count + end + end + + def test_create_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Entry.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + entry_id = "hello world" + entry = {} + + create_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreateEntryRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["entry_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Entry), request["entry"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_entry({ parent: parent, entry_id: entry_id, entry: entry }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_entry parent: parent, entry_id: entry_id, entry: entry do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_entry ::Google::Cloud::DataCatalog::V1::CreateEntryRequest.new(parent: parent, entry_id: entry_id, entry: entry) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_entry({ parent: parent, entry_id: entry_id, entry: entry }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_entry(::Google::Cloud::DataCatalog::V1::CreateEntryRequest.new(parent: parent, entry_id: entry_id, entry: entry), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_entry_client_stub.call_rpc_count + end + end + + def test_update_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Entry.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + entry = {} + update_mask = {} + + update_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Entry), request["entry"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_entry({ entry: entry, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_entry entry: entry, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_entry ::Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new(entry: entry, 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_entry({ entry: entry, 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_entry(::Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new(entry: entry, 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_entry_client_stub.call_rpc_count + end + end + + def test_delete_entry + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_entry({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_entry name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_entry ::Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_entry({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_entry(::Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new(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_entry_client_stub.call_rpc_count + end + end + + def test_get_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Entry.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::GetEntryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_entry({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_entry name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_entry ::Google::Cloud::DataCatalog::V1::GetEntryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_entry({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_entry(::Google::Cloud::DataCatalog::V1::GetEntryRequest.new(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_entry_client_stub.call_rpc_count + end + end + + def test_lookup_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Entry.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + linked_resource = "hello world" + project = "hello world" + location = "hello world" + + lookup_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :lookup_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::LookupEntryRequest, request + assert_equal "hello world", request["linked_resource"] + assert_equal :linked_resource, request.target_name + assert_equal "hello world", request["project"] + assert_equal "hello world", request["location"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, lookup_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.lookup_entry({ linked_resource: linked_resource, project: project, location: location }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.lookup_entry linked_resource: linked_resource, project: project, location: location do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.lookup_entry ::Google::Cloud::DataCatalog::V1::LookupEntryRequest.new(linked_resource: linked_resource, project: project, location: location) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.lookup_entry({ linked_resource: linked_resource, project: project, location: location }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.lookup_entry(::Google::Cloud::DataCatalog::V1::LookupEntryRequest.new(linked_resource: linked_resource, project: project, location: location), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, lookup_entry_client_stub.call_rpc_count + end + end + + def test_list_entries + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ListEntriesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + read_mask = {} + + list_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_entries, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ListEntriesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_entries_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_entries({ parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_entries parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_entries ::Google::Cloud::DataCatalog::V1::ListEntriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_entries({ parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_entries(::Google::Cloud::DataCatalog::V1::ListEntriesRequest.new(parent: parent, page_size: page_size, page_token: page_token, read_mask: read_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_entries_client_stub.call_rpc_count + end + end + + def test_modify_entry_overview + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::EntryOverview.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + entry_overview = {} + + modify_entry_overview_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :modify_entry_overview, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::EntryOverview), request["entry_overview"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, modify_entry_overview_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.modify_entry_overview({ name: name, entry_overview: entry_overview }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.modify_entry_overview name: name, entry_overview: entry_overview do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.modify_entry_overview ::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new(name: name, entry_overview: entry_overview) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.modify_entry_overview({ name: name, entry_overview: entry_overview }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.modify_entry_overview(::Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new(name: name, entry_overview: entry_overview), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, modify_entry_overview_client_stub.call_rpc_count + end + end + + def test_modify_entry_contacts + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Contacts.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + contacts = {} + + modify_entry_contacts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :modify_entry_contacts, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Contacts), request["contacts"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, modify_entry_contacts_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.modify_entry_contacts({ name: name, contacts: contacts }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.modify_entry_contacts name: name, contacts: contacts do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.modify_entry_contacts ::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new(name: name, contacts: contacts) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.modify_entry_contacts({ name: name, contacts: contacts }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.modify_entry_contacts(::Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new(name: name, contacts: contacts), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, modify_entry_contacts_client_stub.call_rpc_count + end + end + + def test_create_tag_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag_template_id = "hello world" + tag_template = {} + + create_tag_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag_template, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["tag_template_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::TagTemplate), request["tag_template"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag_template({ parent: parent, tag_template_id: tag_template_id, tag_template: tag_template }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tag_template parent: parent, tag_template_id: tag_template_id, tag_template: tag_template do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tag_template ::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new(parent: parent, tag_template_id: tag_template_id, tag_template: tag_template) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tag_template({ parent: parent, tag_template_id: tag_template_id, tag_template: tag_template }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tag_template(::Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new(parent: parent, tag_template_id: tag_template_id, tag_template: tag_template), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tag_template_client_stub.call_rpc_count + end + end + + def test_get_tag_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_tag_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tag_template, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tag_template({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tag_template name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tag_template ::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tag_template({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_tag_template(::Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new(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_tag_template_client_stub.call_rpc_count + end + end + + def test_update_tag_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + tag_template = {} + update_mask = {} + + update_tag_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tag_template, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::TagTemplate), request["tag_template"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tag_template({ tag_template: tag_template, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tag_template tag_template: tag_template, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tag_template ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new(tag_template: tag_template, 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_tag_template({ tag_template: tag_template, 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_tag_template(::Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new(tag_template: tag_template, 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_tag_template_client_stub.call_rpc_count + end + end + + def test_delete_tag_template + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + delete_tag_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag_template, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_template_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag_template({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tag_template name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tag_template ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tag_template({ name: name, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_tag_template(::Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_tag_template_client_stub.call_rpc_count + end + end + + def test_create_tag_template_field + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag_template_field_id = "hello world" + tag_template_field = {} + + create_tag_template_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag_template_field, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["tag_template_field_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::TagTemplateField), request["tag_template_field"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag_template_field({ parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tag_template_field parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tag_template_field ::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new(parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tag_template_field({ parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tag_template_field(::Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new(parent: parent, tag_template_field_id: tag_template_field_id, tag_template_field: tag_template_field), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tag_template_field_client_stub.call_rpc_count + end + end + + def test_update_tag_template_field + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + tag_template_field = {} + update_mask = {} + + update_tag_template_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tag_template_field, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::TagTemplateField), request["tag_template_field"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tag_template_field({ name: name, tag_template_field: tag_template_field, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tag_template_field name: name, tag_template_field: tag_template_field, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tag_template_field ::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new(name: name, tag_template_field: tag_template_field, 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_tag_template_field({ name: name, tag_template_field: tag_template_field, 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_tag_template_field(::Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new(name: name, tag_template_field: tag_template_field, 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_tag_template_field_client_stub.call_rpc_count + end + end + + def test_rename_tag_template_field + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + new_tag_template_field_id = "hello world" + + rename_tag_template_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rename_tag_template_field, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["new_tag_template_field_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rename_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rename_tag_template_field({ name: name, new_tag_template_field_id: new_tag_template_field_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rename_tag_template_field name: name, new_tag_template_field_id: new_tag_template_field_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rename_tag_template_field ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new(name: name, new_tag_template_field_id: new_tag_template_field_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rename_tag_template_field({ name: name, new_tag_template_field_id: new_tag_template_field_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rename_tag_template_field(::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new(name: name, new_tag_template_field_id: new_tag_template_field_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rename_tag_template_field_client_stub.call_rpc_count + end + end + + def test_rename_tag_template_field_enum_value + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::TagTemplateField.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + new_enum_value_display_name = "hello world" + + rename_tag_template_field_enum_value_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rename_tag_template_field_enum_value, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["new_enum_value_display_name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rename_tag_template_field_enum_value_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rename_tag_template_field_enum_value({ name: name, new_enum_value_display_name: new_enum_value_display_name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rename_tag_template_field_enum_value name: name, new_enum_value_display_name: new_enum_value_display_name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rename_tag_template_field_enum_value ::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new(name: name, new_enum_value_display_name: new_enum_value_display_name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rename_tag_template_field_enum_value({ name: name, new_enum_value_display_name: new_enum_value_display_name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rename_tag_template_field_enum_value(::Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new(name: name, new_enum_value_display_name: new_enum_value_display_name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rename_tag_template_field_enum_value_client_stub.call_rpc_count + end + end + + def test_delete_tag_template_field + # 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" + force = true + + delete_tag_template_field_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag_template_field, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_template_field_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag_template_field({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tag_template_field name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tag_template_field ::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tag_template_field({ name: name, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_tag_template_field(::Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_tag_template_field_client_stub.call_rpc_count + end + end + + def test_create_tag + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Tag.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag = {} + + create_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreateTagRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Tag), request["tag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tag({ parent: parent, tag: tag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tag parent: parent, tag: tag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tag ::Google::Cloud::DataCatalog::V1::CreateTagRequest.new(parent: parent, tag: tag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tag({ parent: parent, tag: tag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tag(::Google::Cloud::DataCatalog::V1::CreateTagRequest.new(parent: parent, tag: tag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tag_client_stub.call_rpc_count + end + end + + def test_update_tag + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Tag.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + tag = {} + update_mask = {} + + update_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdateTagRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Tag), request["tag"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tag({ tag: tag, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tag tag: tag, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tag ::Google::Cloud::DataCatalog::V1::UpdateTagRequest.new(tag: tag, 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_tag({ tag: tag, 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_tag(::Google::Cloud::DataCatalog::V1::UpdateTagRequest.new(tag: tag, 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_tag_client_stub.call_rpc_count + end + end + + def test_delete_tag + # 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_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeleteTagRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tag({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tag name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tag ::Google::Cloud::DataCatalog::V1::DeleteTagRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tag({ 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_tag(::Google::Cloud::DataCatalog::V1::DeleteTagRequest.new(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_tag_client_stub.call_rpc_count + end + end + + def test_list_tags + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ListTagsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_tags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tags, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ListTagsRequest, 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_tags_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tags({ 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_tags 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_tags ::Google::Cloud::DataCatalog::V1::ListTagsRequest.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_tags({ 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_tags(::Google::Cloud::DataCatalog::V1::ListTagsRequest.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_tags_client_stub.call_rpc_count + end + end + + def test_reconcile_tags + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tag_template = "hello world" + force_delete_missing = true + tags = [{}] + + reconcile_tags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reconcile_tags, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["tag_template"] + assert_equal true, request["force_delete_missing"] + assert_kind_of ::Google::Cloud::DataCatalog::V1::Tag, request["tags"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, reconcile_tags_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reconcile_tags({ parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reconcile_tags parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reconcile_tags ::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new(parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reconcile_tags({ parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reconcile_tags(::Google::Cloud::DataCatalog::V1::ReconcileTagsRequest.new(parent: parent, tag_template: tag_template, force_delete_missing: force_delete_missing, tags: tags), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reconcile_tags_client_stub.call_rpc_count + end + end + + def test_star_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::StarEntryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + star_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :star_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::StarEntryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, star_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.star_entry({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.star_entry name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.star_entry ::Google::Cloud::DataCatalog::V1::StarEntryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.star_entry({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.star_entry(::Google::Cloud::DataCatalog::V1::StarEntryRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, star_entry_client_stub.call_rpc_count + end + end + + def test_unstar_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::UnstarEntryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + unstar_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :unstar_entry, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, unstar_entry_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.unstar_entry({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.unstar_entry name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.unstar_entry ::Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.unstar_entry({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.unstar_entry(::Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, unstar_entry_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_import_entries + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + gcs_bucket_path = "hello world" + job_id = "hello world" + + import_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_entries, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["gcs_bucket_path"] + assert_equal :gcs_bucket_path, request.source + assert_equal "hello world", request["job_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_entries_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_entries({ parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_entries parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_entries ::Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new(parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_entries({ parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_entries(::Google::Cloud::DataCatalog::V1::ImportEntriesRequest.new(parent: parent, gcs_bucket_path: gcs_bucket_path, job_id: job_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_entries_client_stub.call_rpc_count + end + end + + def test_set_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::MigrationConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + tag_template_migration = :TAG_TEMPLATE_MIGRATION_UNSPECIFIED + + set_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_config, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::SetConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal :TAG_TEMPLATE_MIGRATION_UNSPECIFIED, request["tag_template_migration"] + assert_equal :tag_template_migration, request.configuration + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_config_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_config({ name: name, tag_template_migration: tag_template_migration }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_config name: name, tag_template_migration: tag_template_migration do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_config ::Google::Cloud::DataCatalog::V1::SetConfigRequest.new(name: name, tag_template_migration: tag_template_migration) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_config({ name: name, tag_template_migration: tag_template_migration }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_config(::Google::Cloud::DataCatalog::V1::SetConfigRequest.new(name: name, tag_template_migration: tag_template_migration), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_config_client_stub.call_rpc_count + end + end + + def test_retrieve_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::OrganizationConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + retrieve_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :retrieve_config, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, retrieve_config_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.retrieve_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.retrieve_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.retrieve_config ::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.retrieve_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.retrieve_config(::Google::Cloud::DataCatalog::V1::RetrieveConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, retrieve_config_client_stub.call_rpc_count + end + end + + def test_retrieve_effective_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::MigrationConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + retrieve_effective_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :retrieve_effective_config, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, retrieve_effective_config_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.retrieve_effective_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.retrieve_effective_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.retrieve_effective_config ::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.retrieve_effective_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.retrieve_effective_config(::Google::Cloud::DataCatalog::V1::RetrieveEffectiveConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, retrieve_effective_config_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::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::DataCatalog::V1::DataCatalog::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::DataCatalog::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DataCatalog::V1::DataCatalog::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb new file mode 100644 index 000000000000..5022f8f37064 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/data_catalog/v1/policy_tag_manager" + +class ::Google::Cloud::DataCatalog::V1::PolicyTagManager::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::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_policy_tag_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.policy_tag_path project: "value0", location: "value1", taxonomy: "value2", policy_tag: "value3" + assert_equal "projects/value0/locations/value1/taxonomies/value2/policyTags/value3", path + end + end + + def test_taxonomy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.taxonomy_path project: "value0", location: "value1", taxonomy: "value2" + assert_equal "projects/value0/locations/value1/taxonomies/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb new file mode 100644 index 000000000000..a3812ee94ffc --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_rest_test.rb @@ -0,0 +1,814 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/datacatalog/v1/policytagmanager_pb" +require "google/cloud/data_catalog/v1/policy_tag_manager/rest" + + +class ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_taxonomy + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + taxonomy = {} + + create_taxonomy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_create_taxonomy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_taxonomy({ parent: parent, taxonomy: taxonomy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_taxonomy parent: parent, taxonomy: taxonomy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_taxonomy ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new(parent: parent, taxonomy: taxonomy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_taxonomy({ parent: parent, taxonomy: taxonomy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_taxonomy(::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new(parent: parent, taxonomy: taxonomy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_taxonomy_client_stub.call_count + end + end + end + + def test_delete_taxonomy + # 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_taxonomy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_delete_taxonomy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_taxonomy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_taxonomy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_taxonomy ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_taxonomy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_taxonomy(::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_taxonomy_client_stub.call_count + end + end + end + + def test_update_taxonomy + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + taxonomy = {} + update_mask = {} + + update_taxonomy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_update_taxonomy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_taxonomy({ taxonomy: taxonomy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_taxonomy taxonomy: taxonomy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_taxonomy ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new(taxonomy: taxonomy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_taxonomy({ taxonomy: taxonomy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_taxonomy(::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new(taxonomy: taxonomy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_taxonomy_client_stub.call_count + end + end + end + + def test_list_taxonomies + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_taxonomies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_list_taxonomies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_taxonomies_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_taxonomies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_taxonomies parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_taxonomies ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_taxonomies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_taxonomies(::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_taxonomies_client_stub.call_count + end + end + end + + def test_get_taxonomy + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_taxonomy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_get_taxonomy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_taxonomy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_taxonomy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_taxonomy ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_taxonomy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_taxonomy(::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_taxonomy_client_stub.call_count + end + end + end + + def test_create_policy_tag + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::PolicyTag.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy_tag = {} + + create_policy_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_create_policy_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_policy_tag({ parent: parent, policy_tag: policy_tag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_policy_tag parent: parent, policy_tag: policy_tag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_policy_tag ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new(parent: parent, policy_tag: policy_tag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_policy_tag({ parent: parent, policy_tag: policy_tag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_policy_tag(::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new(parent: parent, policy_tag: policy_tag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_policy_tag_client_stub.call_count + end + end + end + + def test_delete_policy_tag + # 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_policy_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_delete_policy_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_policy_tag({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_policy_tag name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_policy_tag ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_policy_tag({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_policy_tag(::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_policy_tag_client_stub.call_count + end + end + end + + def test_update_policy_tag + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::PolicyTag.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + policy_tag = {} + update_mask = {} + + update_policy_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_update_policy_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_policy_tag({ policy_tag: policy_tag, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_policy_tag policy_tag: policy_tag, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_policy_tag ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new(policy_tag: policy_tag, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_policy_tag({ policy_tag: policy_tag, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_policy_tag(::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new(policy_tag: policy_tag, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_policy_tag_client_stub.call_count + end + end + end + + def test_list_policy_tags + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse.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_policy_tags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_list_policy_tags_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_policy_tags_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_policy_tags({ 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_policy_tags 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_policy_tags ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.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_policy_tags({ 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_policy_tags(::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.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_policy_tags_client_stub.call_count + end + end + end + + def test_get_policy_tag + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::PolicyTag.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_policy_tag_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_get_policy_tag_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_policy_tag({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_policy_tag name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_policy_tag ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_policy_tag({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_policy_tag(::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_policy_tag_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::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::DataCatalog::V1::PolicyTagManager::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb new file mode 100644 index 000000000000..564b60c67fa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/data_catalog/v1/policy_tag_manager_serialization" + +class ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::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_taxonomy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.taxonomy_path project: "value0", location: "value1", taxonomy: "value2" + assert_equal "projects/value0/locations/value1/taxonomies/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb new file mode 100644 index 000000000000..333b19db657c --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_rest_test.rb @@ -0,0 +1,265 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License 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/datacatalog/v1/policytagmanagerserialization_pb" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization/rest" + + +class ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_replace_taxonomy + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + serialized_taxonomy = {} + + replace_taxonomy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ServiceStub.stub :transcode_replace_taxonomy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, replace_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.replace_taxonomy({ name: name, serialized_taxonomy: serialized_taxonomy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.replace_taxonomy name: name, serialized_taxonomy: serialized_taxonomy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.replace_taxonomy ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new(name: name, serialized_taxonomy: serialized_taxonomy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.replace_taxonomy({ name: name, serialized_taxonomy: serialized_taxonomy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.replace_taxonomy(::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new(name: name, serialized_taxonomy: serialized_taxonomy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, replace_taxonomy_client_stub.call_count + end + end + end + + def test_import_taxonomies + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + inline_source = {} + + import_taxonomies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ServiceStub.stub :transcode_import_taxonomies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_taxonomies_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_taxonomies({ parent: parent, inline_source: inline_source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_taxonomies parent: parent, inline_source: inline_source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_taxonomies ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new(parent: parent, inline_source: inline_source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_taxonomies({ parent: parent, inline_source: inline_source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_taxonomies(::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new(parent: parent, inline_source: inline_source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_taxonomies_client_stub.call_count + end + end + end + + def test_export_taxonomies + # Create test objects. + client_result = ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + taxonomies = ["hello world"] + serialized_taxonomies = true + + export_taxonomies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::ServiceStub.stub :transcode_export_taxonomies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_taxonomies_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_taxonomies({ parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_taxonomies parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_taxonomies ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new(parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_taxonomies({ parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_taxonomies(::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new(parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_taxonomies_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::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::DataCatalog::V1::PolicyTagManagerSerialization::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb new file mode 100644 index 000000000000..a50278a5cf9f --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_serialization_test.rb @@ -0,0 +1,269 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/datacatalog/v1/policytagmanagerserialization_pb" +require "google/cloud/datacatalog/v1/policytagmanagerserialization_services_pb" +require "google/cloud/data_catalog/v1/policy_tag_manager_serialization" + +class ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_replace_taxonomy + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + serialized_taxonomy = {} + + replace_taxonomy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :replace_taxonomy, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::SerializedTaxonomy), request["serialized_taxonomy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, replace_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.replace_taxonomy({ name: name, serialized_taxonomy: serialized_taxonomy }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.replace_taxonomy name: name, serialized_taxonomy: serialized_taxonomy do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.replace_taxonomy ::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new(name: name, serialized_taxonomy: serialized_taxonomy) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.replace_taxonomy({ name: name, serialized_taxonomy: serialized_taxonomy }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.replace_taxonomy(::Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new(name: name, serialized_taxonomy: serialized_taxonomy), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, replace_taxonomy_client_stub.call_rpc_count + end + end + + def test_import_taxonomies + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + inline_source = {} + + import_taxonomies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_taxonomies, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_taxonomies_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_taxonomies({ parent: parent, inline_source: inline_source }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_taxonomies parent: parent, inline_source: inline_source do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_taxonomies ::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new(parent: parent, inline_source: inline_source) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_taxonomies({ parent: parent, inline_source: inline_source }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_taxonomies(::Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new(parent: parent, inline_source: inline_source), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_taxonomies_client_stub.call_rpc_count + end + end + + def test_export_taxonomies + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + taxonomies = ["hello world"] + serialized_taxonomies = true + + export_taxonomies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_taxonomies, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["taxonomies"] + assert_equal true, request["serialized_taxonomies"] + assert_equal :serialized_taxonomies, request.destination + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_taxonomies_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_taxonomies({ parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_taxonomies parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_taxonomies ::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new(parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_taxonomies({ parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_taxonomies(::Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new(parent: parent, taxonomies: taxonomies, serialized_taxonomies: serialized_taxonomies), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_taxonomies_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::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::DataCatalog::V1::PolicyTagManagerSerialization::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb new file mode 100644 index 000000000000..eaf48629b5c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/google/cloud/data_catalog/v1/policy_tag_manager_test.rb @@ -0,0 +1,875 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing 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/datacatalog/v1/policytagmanager_pb" +require "google/cloud/datacatalog/v1/policytagmanager_services_pb" +require "google/cloud/data_catalog/v1/policy_tag_manager" + +class ::Google::Cloud::DataCatalog::V1::PolicyTagManager::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_taxonomy + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + taxonomy = {} + + create_taxonomy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_taxonomy, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Taxonomy), request["taxonomy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_taxonomy({ parent: parent, taxonomy: taxonomy }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_taxonomy parent: parent, taxonomy: taxonomy do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_taxonomy ::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new(parent: parent, taxonomy: taxonomy) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_taxonomy({ parent: parent, taxonomy: taxonomy }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_taxonomy(::Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new(parent: parent, taxonomy: taxonomy), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_taxonomy_client_stub.call_rpc_count + end + end + + def test_delete_taxonomy + # 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_taxonomy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_taxonomy, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_taxonomy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_taxonomy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_taxonomy ::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_taxonomy({ 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_taxonomy(::Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new(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_taxonomy_client_stub.call_rpc_count + end + end + + def test_update_taxonomy + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + taxonomy = {} + update_mask = {} + + update_taxonomy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_taxonomy, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::Taxonomy), request["taxonomy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_taxonomy({ taxonomy: taxonomy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_taxonomy taxonomy: taxonomy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_taxonomy ::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new(taxonomy: taxonomy, 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_taxonomy({ taxonomy: taxonomy, 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_taxonomy(::Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new(taxonomy: taxonomy, 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_taxonomy_client_stub.call_rpc_count + end + end + + def test_list_taxonomies + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ListTaxonomiesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_taxonomies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_taxonomies, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_taxonomies_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_taxonomies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_taxonomies parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_taxonomies ::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_taxonomies({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_taxonomies(::Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_taxonomies_client_stub.call_rpc_count + end + end + + def test_get_taxonomy + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::Taxonomy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_taxonomy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_taxonomy, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_taxonomy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_taxonomy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_taxonomy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_taxonomy ::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_taxonomy({ 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_taxonomy(::Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new(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_taxonomy_client_stub.call_rpc_count + end + end + + def test_create_policy_tag + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::PolicyTag.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy_tag = {} + + create_policy_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_policy_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::PolicyTag), request["policy_tag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_policy_tag({ parent: parent, policy_tag: policy_tag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_policy_tag parent: parent, policy_tag: policy_tag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_policy_tag ::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new(parent: parent, policy_tag: policy_tag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_policy_tag({ parent: parent, policy_tag: policy_tag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_policy_tag(::Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new(parent: parent, policy_tag: policy_tag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_policy_tag_client_stub.call_rpc_count + end + end + + def test_delete_policy_tag + # 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_policy_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_policy_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_policy_tag({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_policy_tag name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_policy_tag ::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_policy_tag({ 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_policy_tag(::Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new(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_policy_tag_client_stub.call_rpc_count + end + end + + def test_update_policy_tag + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::PolicyTag.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + policy_tag = {} + update_mask = {} + + update_policy_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_policy_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DataCatalog::V1::PolicyTag), request["policy_tag"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_policy_tag({ policy_tag: policy_tag, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_policy_tag policy_tag: policy_tag, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_policy_tag ::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new(policy_tag: policy_tag, 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_policy_tag({ policy_tag: policy_tag, 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_policy_tag(::Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new(policy_tag: policy_tag, 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_policy_tag_client_stub.call_rpc_count + end + end + + def test_list_policy_tags + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::ListPolicyTagsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_policy_tags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_policy_tags, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest, 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_policy_tags_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_policy_tags({ 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_policy_tags 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_policy_tags ::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.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_policy_tags({ 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_policy_tags(::Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.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_policy_tags_client_stub.call_rpc_count + end + end + + def test_get_policy_tag + # Create GRPC objects. + grpc_response = ::Google::Cloud::DataCatalog::V1::PolicyTag.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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_policy_tag_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_policy_tag, name + assert_kind_of ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_policy_tag_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_policy_tag({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_policy_tag name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_policy_tag ::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_policy_tag({ 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_policy_tag(::Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new(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_policy_tag_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DataCatalog::V1::PolicyTagManager::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::DataCatalog::V1::PolicyTagManager::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-data_catalog-v1/test/helper.rb b/owl-bot-staging/google-cloud-data_catalog-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-cloud-data_catalog-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct"