From 5168e1725ba6a3024d91c919b1791b8011881999 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 19 Oct 2025 10:02:50 +0000 Subject: [PATCH] feat: Automated regeneration of bigquerydatapolicy v2 client --- api_names_out.yaml | 93 +++ .../.repo-metadata.json | 7 + .../google-apis-bigquerydatapolicy_v2/.rspec | 2 + .../.toys.rb | 57 ++ .../.yardopts | 13 + .../CHANGELOG.md | 7 + .../google-apis-bigquerydatapolicy_v2/Gemfile | 23 + .../LICENSE.md | 202 +++++ .../OVERVIEW.md | 96 +++ .../Rakefile | 28 + .../google-apis-bigquerydatapolicy_v2.gemspec | 33 + .../lib/google-apis-bigquerydatapolicy_v2.rb | 15 + .../lib/google/apis/bigquerydatapolicy_v2.rb | 39 + .../apis/bigquerydatapolicy_v2/classes.rb | 703 ++++++++++++++++++ .../apis/bigquerydatapolicy_v2/gem_version.rb | 28 + .../bigquerydatapolicy_v2/representations.rb | 276 +++++++ .../apis/bigquerydatapolicy_v2/service.rb | 431 +++++++++++ .../spec/generated_spec.rb | 27 + 18 files changed, 2080 insertions(+) create mode 100644 generated/google-apis-bigquerydatapolicy_v2/.repo-metadata.json create mode 100644 generated/google-apis-bigquerydatapolicy_v2/.rspec create mode 100644 generated/google-apis-bigquerydatapolicy_v2/.toys.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/.yardopts create mode 100644 generated/google-apis-bigquerydatapolicy_v2/CHANGELOG.md create mode 100644 generated/google-apis-bigquerydatapolicy_v2/Gemfile create mode 100644 generated/google-apis-bigquerydatapolicy_v2/LICENSE.md create mode 100644 generated/google-apis-bigquerydatapolicy_v2/OVERVIEW.md create mode 100644 generated/google-apis-bigquerydatapolicy_v2/Rakefile create mode 100644 generated/google-apis-bigquerydatapolicy_v2/google-apis-bigquerydatapolicy_v2.gemspec create mode 100644 generated/google-apis-bigquerydatapolicy_v2/lib/google-apis-bigquerydatapolicy_v2.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/classes.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/gem_version.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/representations.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/service.rb create mode 100644 generated/google-apis-bigquerydatapolicy_v2/spec/generated_spec.rb diff --git a/api_names_out.yaml b/api_names_out.yaml index 3e72c8b351a..df819c8a5ff 100644 --- a/api_names_out.yaml +++ b/api_names_out.yaml @@ -55628,6 +55628,99 @@ "/bigquerydatapolicy:v1/fields": fields "/bigquerydatapolicy:v1/key": key "/bigquerydatapolicy:v1/quotaUser": quota_user +"/bigquerydatapolicy:v2/AddGranteesRequest": add_grantees_request +"/bigquerydatapolicy:v2/AddGranteesRequest/grantees": grantees +"/bigquerydatapolicy:v2/AddGranteesRequest/grantees/grantee": grantee +"/bigquerydatapolicy:v2/AuditConfig": audit_config +"/bigquerydatapolicy:v2/AuditConfig/auditLogConfigs": audit_log_configs +"/bigquerydatapolicy:v2/AuditConfig/auditLogConfigs/audit_log_config": audit_log_config +"/bigquerydatapolicy:v2/AuditConfig/service": service +"/bigquerydatapolicy:v2/AuditLogConfig": audit_log_config +"/bigquerydatapolicy:v2/AuditLogConfig/exemptedMembers": exempted_members +"/bigquerydatapolicy:v2/AuditLogConfig/exemptedMembers/exempted_member": exempted_member +"/bigquerydatapolicy:v2/AuditLogConfig/logType": log_type +"/bigquerydatapolicy:v2/Binding": binding +"/bigquerydatapolicy:v2/Binding/condition": condition +"/bigquerydatapolicy:v2/Binding/members": members +"/bigquerydatapolicy:v2/Binding/members/member": member +"/bigquerydatapolicy:v2/Binding/role": role +"/bigquerydatapolicy:v2/CreateDataPolicyRequest": create_data_policy_request +"/bigquerydatapolicy:v2/CreateDataPolicyRequest/dataPolicy": data_policy +"/bigquerydatapolicy:v2/CreateDataPolicyRequest/dataPolicyId": data_policy_id +"/bigquerydatapolicy:v2/DataMaskingPolicy": data_masking_policy +"/bigquerydatapolicy:v2/DataMaskingPolicy/predefinedExpression": predefined_expression +"/bigquerydatapolicy:v2/DataMaskingPolicy/routine": routine +"/bigquerydatapolicy:v2/DataPolicy": data_policy +"/bigquerydatapolicy:v2/DataPolicy/dataMaskingPolicy": data_masking_policy +"/bigquerydatapolicy:v2/DataPolicy/dataPolicyId": data_policy_id +"/bigquerydatapolicy:v2/DataPolicy/dataPolicyType": data_policy_type +"/bigquerydatapolicy:v2/DataPolicy/etag": etag +"/bigquerydatapolicy:v2/DataPolicy/grantees": grantees +"/bigquerydatapolicy:v2/DataPolicy/grantees/grantee": grantee +"/bigquerydatapolicy:v2/DataPolicy/name": name +"/bigquerydatapolicy:v2/DataPolicy/policyTag": policy_tag +"/bigquerydatapolicy:v2/DataPolicy/version": version +"/bigquerydatapolicy:v2/Empty": empty +"/bigquerydatapolicy:v2/Expr": expr +"/bigquerydatapolicy:v2/Expr/description": description +"/bigquerydatapolicy:v2/Expr/expression": expression +"/bigquerydatapolicy:v2/Expr/location": location +"/bigquerydatapolicy:v2/Expr/title": title +"/bigquerydatapolicy:v2/GetIamPolicyRequest": get_iam_policy_request +"/bigquerydatapolicy:v2/GetIamPolicyRequest/options": options +"/bigquerydatapolicy:v2/GetPolicyOptions": get_policy_options +"/bigquerydatapolicy:v2/GetPolicyOptions/requestedPolicyVersion": requested_policy_version +"/bigquerydatapolicy:v2/ListDataPoliciesResponse": list_data_policies_response +"/bigquerydatapolicy:v2/ListDataPoliciesResponse/dataPolicies": data_policies +"/bigquerydatapolicy:v2/ListDataPoliciesResponse/dataPolicies/data_policy": data_policy +"/bigquerydatapolicy:v2/ListDataPoliciesResponse/nextPageToken": next_page_token +"/bigquerydatapolicy:v2/Policy": policy +"/bigquerydatapolicy:v2/Policy/auditConfigs": audit_configs +"/bigquerydatapolicy:v2/Policy/auditConfigs/audit_config": audit_config +"/bigquerydatapolicy:v2/Policy/bindings": bindings +"/bigquerydatapolicy:v2/Policy/bindings/binding": binding +"/bigquerydatapolicy:v2/Policy/etag": etag +"/bigquerydatapolicy:v2/Policy/version": version +"/bigquerydatapolicy:v2/RemoveGranteesRequest": remove_grantees_request +"/bigquerydatapolicy:v2/RemoveGranteesRequest/grantees": grantees +"/bigquerydatapolicy:v2/RemoveGranteesRequest/grantees/grantee": grantee +"/bigquerydatapolicy:v2/SetIamPolicyRequest": set_iam_policy_request +"/bigquerydatapolicy:v2/SetIamPolicyRequest/policy": policy +"/bigquerydatapolicy:v2/SetIamPolicyRequest/updateMask": update_mask +"/bigquerydatapolicy:v2/TestIamPermissionsRequest": test_iam_permissions_request +"/bigquerydatapolicy:v2/TestIamPermissionsRequest/permissions": permissions +"/bigquerydatapolicy:v2/TestIamPermissionsRequest/permissions/permission": permission +"/bigquerydatapolicy:v2/TestIamPermissionsResponse": test_iam_permissions_response +"/bigquerydatapolicy:v2/TestIamPermissionsResponse/permissions": permissions +"/bigquerydatapolicy:v2/TestIamPermissionsResponse/permissions/permission": permission +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.addGrantees": add_data_policy_grantees +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.addGrantees/dataPolicy": data_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.create": create_data_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.create/parent": parent +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.delete": delete_project_location_data_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.delete/name": name +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.get": get_project_location_data_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.get/name": name +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy": get_data_policy_iam_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.getIamPolicy/resource": resource +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.list": list_project_location_data_policies +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.list/filter": filter +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.list/pageSize": page_size +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.list/pageToken": page_token +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.list/parent": parent +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.patch": patch_project_location_data_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.patch/allowMissing": allow_missing +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.patch/name": name +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.patch/updateMask": update_mask +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.removeGrantees": remove_data_policy_grantees +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.removeGrantees/dataPolicy": data_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy": set_data_policy_iam_policy +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.setIamPolicy/resource": resource +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions": test_data_policy_iam_permissions +"/bigquerydatapolicy:v2/bigquerydatapolicy.projects.locations.dataPolicies.testIamPermissions/resource": resource +"/bigquerydatapolicy:v2/fields": fields +"/bigquerydatapolicy:v2/key": key +"/bigquerydatapolicy:v2/quotaUser": quota_user "/bigquerydatatransfer:v1/CheckValidCredsRequest": check_valid_creds_request "/bigquerydatatransfer:v1/CheckValidCredsResponse": check_valid_creds_response "/bigquerydatatransfer:v1/CheckValidCredsResponse/hasValidCreds": has_valid_creds diff --git a/generated/google-apis-bigquerydatapolicy_v2/.repo-metadata.json b/generated/google-apis-bigquerydatapolicy_v2/.repo-metadata.json new file mode 100644 index 00000000000..413c6f06e2d --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/.repo-metadata.json @@ -0,0 +1,7 @@ +{ + "api_id": "bigquerydatapolicy:v2", + "name_pretty": "BigQuery Data Policy API", + "distribution_name": "google-apis-bigquerydatapolicy_v2", + "language": "ruby", + "library_type": "REST" +} diff --git a/generated/google-apis-bigquerydatapolicy_v2/.rspec b/generated/google-apis-bigquerydatapolicy_v2/.rspec new file mode 100644 index 00000000000..16f9cdb0135 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/.rspec @@ -0,0 +1,2 @@ +--color +--format documentation diff --git a/generated/google-apis-bigquerydatapolicy_v2/.toys.rb b/generated/google-apis-bigquerydatapolicy_v2/.toys.rb new file mode 100644 index 00000000000..5754f95708a --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/.toys.rb @@ -0,0 +1,57 @@ +expand :clean, paths: :gitignore + +expand :rspec do |t| + t.libs = ["lib", "spec"] + t.use_bundler +end + +expand :yardoc do |t| + t.generate_output_flag = true + t.use_bundler +end + +expand :gem_build + +tool "bundle" do + flag :update + + include :exec, e: true + + def run + exec ["bundle", update ? "update" : "install"] + end +end + +tool "ci" do + include :terminal + include :exec + + def run + Dir.chdir context_directory + @gem_name = File.basename context_directory + @failures = [] + step "bundle" + step "spec" + step "yardoc" + step "build" + if @failures.empty? + puts "CI SUCEEDED", :green, :bold + else + puts "CI FAILED", :red, :bold + @failures.each { |name| puts " failed: #{name}", :red, :bold } + exit 1 + end + end + + def step tool + full_name = "#{@gem_name}:#{tool}" + puts "Starting: #{full_name}...", :cyan, :bold + result = exec_separate_tool [tool] + if result.success? + puts "SUCCESS: #{full_name}", :green, :bold + else + @failures << full_name + puts "FAILED: #{full_name}", :red, :bold + end + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/.yardopts b/generated/google-apis-bigquerydatapolicy_v2/.yardopts new file mode 100644 index 00000000000..717c943ad63 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/.yardopts @@ -0,0 +1,13 @@ +--hide-void-return +--no-private +--verbose +--title=google-apis-bigquerydatapolicy_v2 +--markup-provider=redcarpet +--markup=markdown +--main OVERVIEW.md +lib/google/apis/bigquerydatapolicy_v2/*.rb +lib/google/apis/bigquerydatapolicy_v2.rb +- +OVERVIEW.md +CHANGELOG.md +LICENSE.md diff --git a/generated/google-apis-bigquerydatapolicy_v2/CHANGELOG.md b/generated/google-apis-bigquerydatapolicy_v2/CHANGELOG.md new file mode 100644 index 00000000000..16e134b36b7 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release history for google-apis-bigquerydatapolicy_v2 + +### v0.1.0 (2025-10-19) + +* Regenerated from discovery document revision 20251001 +* Regenerated using generator version 0.18.0 + diff --git a/generated/google-apis-bigquerydatapolicy_v2/Gemfile b/generated/google-apis-bigquerydatapolicy_v2/Gemfile new file mode 100644 index 00000000000..6fa8bb627a6 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/Gemfile @@ -0,0 +1,23 @@ +source 'https://rubygems.org' + +gemspec + +group :development do + gem "bundler", ">= 1.17" + gem "rake", ">= 12.0" + gem "rspec", "~> 3.9" + gem "opencensus", "~> 0.5" +end + +platforms :jruby do + group :development do + gem "jruby-openssl" + end +end + +platforms :ruby do + group :development do + gem "yard", "~> 0.9", ">= 0.9.25" + gem "redcarpet", "~> 3.5" + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/LICENSE.md b/generated/google-apis-bigquerydatapolicy_v2/LICENSE.md new file mode 100644 index 00000000000..32916804156 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/LICENSE.md @@ -0,0 +1,202 @@ + + 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/generated/google-apis-bigquerydatapolicy_v2/OVERVIEW.md b/generated/google-apis-bigquerydatapolicy_v2/OVERVIEW.md new file mode 100644 index 00000000000..f241b480f70 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/OVERVIEW.md @@ -0,0 +1,96 @@ +# Simple REST client for version V2 of the BigQuery Data Policy API + +This is a simple client library for version V2 of the BigQuery Data Policy API. It provides: + +* A client object that connects to the HTTP/JSON REST endpoint for the service. +* Ruby objects for data structures related to the service. +* Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts. +* Control of retry, pagination, and timeouts. + +Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information. + +## Getting started + +### Before you begin + +There are a few setup steps you need to complete before you can use this library: + + 1. If you don't already have a Google account, [sign up](https://www.google.com/accounts). + 2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/). + 3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/bigquerydatapolicy.googleapis.com) in the console. + +### Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'google-apis-bigquerydatapolicy_v2', '~> 0.1' +``` + +And then execute: + +``` +$ bundle +``` + +Or install it yourself as: + +``` +$ gem install google-apis-bigquerydatapolicy_v2 +``` + +### Creating a client object + +Once the gem is installed, you can load the client code and instantiate a client. + +```ruby +# Load the client +require "google/apis/bigquerydatapolicy_v2" + +# Create a client object +client = Google::Apis::BigquerydatapolicyV2::BigQueryDataPolicyServiceService.new + +# Authenticate calls +client.authorization = # ... use the googleauth gem to create credentials +``` + +See the class reference docs for information on the methods you can call from a client. + +## Documentation + +More detailed descriptions of the Google simple REST clients are available in two documents. + + * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging. + * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables. + +(Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Bigquerydatapolicy service in particular.) + +For reference information on specific calls in the BigQuery Data Policy API, see the {Google::Apis::BigquerydatapolicyV2::BigQueryDataPolicyServiceService class reference docs}. + +## Which client should I use? + +Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**. + +This library, `google-apis-bigquerydatapolicy_v2`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-_`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward. + +Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients. + +Gem names for modern clients are often of the form `google-cloud-`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud--`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended. + +**For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure. + +The [product documentation](https://cloud.google.com/bigquery/docs/column-data-masking) may provide guidance regarding the preferred client library to use. + +## Supported Ruby versions + +This library is supported on Ruby 3.1+. + +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. + +## License + +This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}. + +## Support + +Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com). diff --git a/generated/google-apis-bigquerydatapolicy_v2/Rakefile b/generated/google-apis-bigquerydatapolicy_v2/Rakefile new file mode 100644 index 00000000000..defbde59776 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/Rakefile @@ -0,0 +1,28 @@ +require "bundler/gem_tasks" +task :release_gem do + Rake::Task["build"].invoke + Rake::Task["release:rubygem_push"].invoke +end + +require 'rake/clean' +CLOBBER.include('coverage', 'doc') +CLEAN.include('.yardoc') + +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new(:spec) + +begin + require 'yard' + require 'yard/rake/yardoc_task' + YARD::Rake::YardocTask.new do |t| + t.files = ['lib/**/*.rb', 'generated/**/*.rb'] + t.options = ['--verbose', '--markup', 'markdown'] + end +rescue LoadError + task :yard + puts "YARD not available" +end + +task :ci => [:spec, :yard, :build] + +task :default => :ci diff --git a/generated/google-apis-bigquerydatapolicy_v2/google-apis-bigquerydatapolicy_v2.gemspec b/generated/google-apis-bigquerydatapolicy_v2/google-apis-bigquerydatapolicy_v2.gemspec new file mode 100644 index 00000000000..5cb9ab075ba --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/google-apis-bigquerydatapolicy_v2.gemspec @@ -0,0 +1,33 @@ +require File.expand_path("lib/google/apis/bigquerydatapolicy_v2/gem_version", __dir__) +gem_version = Google::Apis::BigquerydatapolicyV2::GEM_VERSION + +Gem::Specification.new do |gem| + gem.name = "google-apis-bigquerydatapolicy_v2" + gem.version = gem_version + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.summary = "Simple REST client for BigQuery Data Policy API V2" + gem.description = + "This is the simple REST client for BigQuery Data Policy API V2." \ + " Simple REST clients are Ruby client libraries that provide access to" \ + " Google services via their HTTP REST API endpoints. These libraries are" \ + " generated and updated automatically based on the discovery documents" \ + " published by the service, and they handle most concerns such as" \ + " authentication, pagination, retry, timeouts, and logging. You can use" \ + " this client to access the BigQuery Data Policy API, but note that some" \ + " services may provide a separate modern client that is easier to use." + gem.homepage = "https://github.com/google/google-api-ruby-client" + gem.license = "Apache-2.0" + gem.metadata = { + "bug_tracker_uri" => "https://github.com/googleapis/google-api-ruby-client/issues", + "changelog_uri" => "https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-bigquerydatapolicy_v2/CHANGELOG.md", + "documentation_uri" => "https://googleapis.dev/ruby/google-apis-bigquerydatapolicy_v2/v#{gem_version}", + "source_code_uri" => "https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-bigquerydatapolicy_v2" + } + + gem.files = Dir.glob("lib/**/*.rb") + Dir.glob("*.md") + [".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = '>= 3.1' + gem.add_runtime_dependency "google-apis-core", ">= 0.15.0", "< 2.a" +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/lib/google-apis-bigquerydatapolicy_v2.rb b/generated/google-apis-bigquerydatapolicy_v2/lib/google-apis-bigquerydatapolicy_v2.rb new file mode 100644 index 00000000000..79e61d44df3 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/lib/google-apis-bigquerydatapolicy_v2.rb @@ -0,0 +1,15 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "google/apis/bigquerydatapolicy_v2" diff --git a/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2.rb b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2.rb new file mode 100644 index 00000000000..f6ca0cf1d1c --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2.rb @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'google/apis/bigquerydatapolicy_v2/service.rb' +require 'google/apis/bigquerydatapolicy_v2/classes.rb' +require 'google/apis/bigquerydatapolicy_v2/representations.rb' +require 'google/apis/bigquerydatapolicy_v2/gem_version.rb' + +module Google + module Apis + # BigQuery Data Policy API + # + # Allows users to manage BigQuery data policies. + # + # @see https://cloud.google.com/bigquery/docs/column-data-masking + module BigquerydatapolicyV2 + # Version of the BigQuery Data Policy API this client connects to. + # This is NOT the gem version. + VERSION = 'V2' + + # View and manage your data in Google BigQuery and see the email address for your Google Account + AUTH_BIGQUERY = 'https://www.googleapis.com/auth/bigquery' + + # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. + AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform' + end + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/classes.rb b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/classes.rb new file mode 100644 index 00000000000..5e6c6da872e --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/classes.rb @@ -0,0 +1,703 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'date' +require 'google/apis/core/base_service' +require 'google/apis/core/json_representation' +require 'google/apis/core/hashable' +require 'google/apis/errors' + +module Google + module Apis + module BigquerydatapolicyV2 + + # Request message for the AddGrantees method. + class AddGranteesRequest + include Google::Apis::Core::Hashable + + # Required. IAM principal that should be granted Fine Grained Access to the + # underlying data goverened by the data policy. The target data policy is + # determined by the `data_policy` field. Uses the [IAM V2 principal syntax]( + # https://cloud.google.com/iam/docs/principal-identifiers#v2). Supported + # principal types: * User * Group * Service account + # Corresponds to the JSON property `grantees` + # @return [Array] + attr_accessor :grantees + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @grantees = args[:grantees] if args.key?(:grantees) + end + end + + # Specifies the audit configuration for a service. The configuration determines + # which permission types are logged, and what identities, if any, are exempted + # from logging. An AuditConfig must have one or more AuditLogConfigs. If there + # are AuditConfigs for both `allServices` and a specific service, the union of + # the two AuditConfigs is used for that service: the log_types specified in each + # AuditConfig are enabled, and the exempted_members in each AuditLogConfig are + # exempted. Example Policy with multiple AuditConfigs: ` "audit_configs": [ ` " + # service": "allServices", "audit_log_configs": [ ` "log_type": "DATA_READ", " + # exempted_members": [ "user:jose@example.com" ] `, ` "log_type": "DATA_WRITE" `, + # ` "log_type": "ADMIN_READ" ` ] `, ` "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ ` "log_type": "DATA_READ" `, ` "log_type": "DATA_WRITE" + # , "exempted_members": [ "user:aliya@example.com" ] ` ] ` ] ` For sampleservice, + # this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also + # exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` + # from DATA_WRITE logging. + class AuditConfig + include Google::Apis::Core::Hashable + + # The configuration for logging of each type of permission. + # Corresponds to the JSON property `auditLogConfigs` + # @return [Array] + attr_accessor :audit_log_configs + + # Specifies a service that will be enabled for audit logging. For example, ` + # storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special + # value that covers all services. + # Corresponds to the JSON property `service` + # @return [String] + attr_accessor :service + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs) + @service = args[:service] if args.key?(:service) + end + end + + # Provides the configuration for logging a type of permissions. Example: ` " + # audit_log_configs": [ ` "log_type": "DATA_READ", "exempted_members": [ "user: + # jose@example.com" ] `, ` "log_type": "DATA_WRITE" ` ] ` This enables ' + # DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from + # DATA_READ logging. + class AuditLogConfig + include Google::Apis::Core::Hashable + + # Specifies the identities that do not cause logging for this type of permission. + # Follows the same format of Binding.members. + # Corresponds to the JSON property `exemptedMembers` + # @return [Array] + attr_accessor :exempted_members + + # The log type that this config enables. + # Corresponds to the JSON property `logType` + # @return [String] + attr_accessor :log_type + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @exempted_members = args[:exempted_members] if args.key?(:exempted_members) + @log_type = args[:log_type] if args.key?(:log_type) + end + end + + # Associates `members`, or principals, with a `role`. + class Binding + include Google::Apis::Core::Hashable + + # 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. + # Corresponds to the JSON property `condition` + # @return [Google::Apis::BigquerydatapolicyV2::Expr] + attr_accessor :condition + + # Specifies the principals requesting access for a Google Cloud resource. ` + # members` can have the following values: * `allUsers`: A special identifier + # that represents anyone who is on the internet; with or without a Google + # account. * `allAuthenticatedUsers`: A special identifier that represents + # anyone who is authenticated with a Google account or a service account. Does + # not include identities that come from external identity providers (IdPs) + # through identity federation. * `user:`emailid``: An email address that + # represents a specific Google account. For example, `alice@example.com` . * ` + # serviceAccount:`emailid``: An email address that represents a Google service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. * ` + # serviceAccount:`projectid`.svc.id.goog[`namespace`/`kubernetes-sa`]`: An + # identifier for a [Kubernetes service account](https://cloud.google.com/ + # kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my- + # project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:`emailid``: An + # email address that represents a Google group. For example, `admins@example.com` + # . * `domain:`domain``: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. * `principal: + # //iam.googleapis.com/locations/global/workforcePools/`pool_id`/subject/` + # subject_attribute_value``: A single identity in a workforce identity pool. * ` + # principalSet://iam.googleapis.com/locations/global/workforcePools/`pool_id`/ + # group/`group_id``: All workforce identities in a group. * `principalSet://iam. + # googleapis.com/locations/global/workforcePools/`pool_id`/attribute.` + # attribute_name`/`attribute_value``: All workforce identities with a specific + # attribute value. * `principalSet://iam.googleapis.com/locations/global/ + # workforcePools/`pool_id`/*`: All identities in a workforce identity pool. * ` + # principal://iam.googleapis.com/projects/`project_number`/locations/global/ + # workloadIdentityPools/`pool_id`/subject/`subject_attribute_value``: A single + # identity in a workload identity pool. * `principalSet://iam.googleapis.com/ + # projects/`project_number`/locations/global/workloadIdentityPools/`pool_id`/ + # group/`group_id``: A workload identity pool group. * `principalSet://iam. + # googleapis.com/projects/`project_number`/locations/global/ + # workloadIdentityPools/`pool_id`/attribute.`attribute_name`/`attribute_value``: + # All identities in a workload identity pool with a certain attribute. * ` + # principalSet://iam.googleapis.com/projects/`project_number`/locations/global/ + # workloadIdentityPools/`pool_id`/*`: All identities in a workload identity pool. + # * `deleted:user:`emailid`?uid=`uniqueid``: An email address (plus unique + # identifier) representing a user that has been recently deleted. For example, ` + # alice@example.com?uid=123456789012345678901`. If the user is recovered, this + # value reverts to `user:`emailid`` and the recovered user retains the role in + # the binding. * `deleted:serviceAccount:`emailid`?uid=`uniqueid``: An email + # address (plus unique identifier) representing a service account that has been + # recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid= + # 123456789012345678901`. If the service account is undeleted, this value + # reverts to `serviceAccount:`emailid`` and the undeleted service account + # retains the role in the binding. * `deleted:group:`emailid`?uid=`uniqueid``: + # An email address (plus unique identifier) representing a Google group that has + # been recently deleted. For example, `admins@example.com?uid= + # 123456789012345678901`. If the group is recovered, this value reverts to ` + # group:`emailid`` and the recovered group retains the role in the binding. * ` + # deleted:principal://iam.googleapis.com/locations/global/workforcePools/` + # pool_id`/subject/`subject_attribute_value``: Deleted single identity in a + # workforce identity pool. For example, `deleted:principal://iam.googleapis.com/ + # locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + # Corresponds to the JSON property `members` + # @return [Array] + attr_accessor :members + + # Role that is assigned to the list of `members`, or principals. For example, ` + # roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM + # roles and permissions, see the [IAM documentation](https://cloud.google.com/ + # iam/docs/roles-overview). For a list of the available pre-defined roles, see [ + # here](https://cloud.google.com/iam/docs/understanding-roles). + # Corresponds to the JSON property `role` + # @return [String] + attr_accessor :role + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @condition = args[:condition] if args.key?(:condition) + @members = args[:members] if args.key?(:members) + @role = args[:role] if args.key?(:role) + end + end + + # Request message for the CreateDataPolicy method. + class CreateDataPolicyRequest + include Google::Apis::Core::Hashable + + # Represents the label-policy binding. + # Corresponds to the JSON property `dataPolicy` + # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy] + attr_accessor :data_policy + + # Required. User-assigned (human readable) ID of the data policy that needs to + # be unique within a project. Used as `data_policy_id` in part of the resource + # name. + # Corresponds to the JSON property `dataPolicyId` + # @return [String] + attr_accessor :data_policy_id + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @data_policy = args[:data_policy] if args.key?(:data_policy) + @data_policy_id = args[:data_policy_id] if args.key?(:data_policy_id) + end + end + + # The policy used to specify data masking rule. + class DataMaskingPolicy + include Google::Apis::Core::Hashable + + # Optional. A predefined masking expression. + # Corresponds to the JSON property `predefinedExpression` + # @return [String] + attr_accessor :predefined_expression + + # Optional. The name of the BigQuery routine that contains the custom masking + # routine, in the format of `projects/`project_number`/datasets/`dataset_id`/ + # routines/`routine_id``. + # Corresponds to the JSON property `routine` + # @return [String] + attr_accessor :routine + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @predefined_expression = args[:predefined_expression] if args.key?(:predefined_expression) + @routine = args[:routine] if args.key?(:routine) + end + end + + # Represents the label-policy binding. + class DataPolicy + include Google::Apis::Core::Hashable + + # The policy used to specify data masking rule. + # Corresponds to the JSON property `dataMaskingPolicy` + # @return [Google::Apis::BigquerydatapolicyV2::DataMaskingPolicy] + attr_accessor :data_masking_policy + + # Output only. User-assigned (human readable) ID of the data policy that needs + # to be unique within a project. Used as `data_policy_id` in part of the + # resource name. + # Corresponds to the JSON property `dataPolicyId` + # @return [String] + attr_accessor :data_policy_id + + # Required. Type of data policy. + # Corresponds to the JSON property `dataPolicyType` + # @return [String] + attr_accessor :data_policy_type + + # The etag for this Data Policy. This field is used for UpdateDataPolicy calls. + # If Data Policy exists, this field is required and must match the server's etag. + # It will also be populated in the response of GetDataPolicy, CreateDataPolicy, + # and UpdateDataPolicy calls. + # Corresponds to the JSON property `etag` + # @return [String] + attr_accessor :etag + + # Optional. The list of IAM principals that have Fine Grained Access to the + # underlying data goverened by this data policy. Uses the [IAM V2 principal + # syntax](https://cloud.google.com/iam/docs/principal-identifiers#v2) Only + # supports principal types users, groups, serviceaccounts, cloudidentity. This + # field is supported in V2 Data Policy only. In case of V1 data policies (i.e. + # verion = 1 and policy_tag is set), this field is not populated. + # Corresponds to the JSON property `grantees` + # @return [Array] + attr_accessor :grantees + + # Identifier. Resource name of this data policy, in the format of `projects/` + # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``. + # Corresponds to the JSON property `name` + # @return [String] + attr_accessor :name + + # Output only. Policy tag resource name, in the format of `projects/` + # project_number`/locations/`location_id`/taxonomies/`taxonomy_id`/policyTags/` + # policyTag_id``. policy_tag is supported only for V1 data policies. + # Corresponds to the JSON property `policyTag` + # @return [String] + attr_accessor :policy_tag + + # Output only. The version of the Data Policy resource. + # Corresponds to the JSON property `version` + # @return [String] + attr_accessor :version + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @data_masking_policy = args[:data_masking_policy] if args.key?(:data_masking_policy) + @data_policy_id = args[:data_policy_id] if args.key?(:data_policy_id) + @data_policy_type = args[:data_policy_type] if args.key?(:data_policy_type) + @etag = args[:etag] if args.key?(:etag) + @grantees = args[:grantees] if args.key?(:grantees) + @name = args[:name] if args.key?(:name) + @policy_tag = args[:policy_tag] if args.key?(:policy_tag) + @version = args[:version] if args.key?(:version) + end + end + + # 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::Apis::Core::Hashable + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + end + end + + # 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. + class Expr + include Google::Apis::Core::Hashable + + # Optional. Description of the expression. This is a longer text which describes + # the expression, e.g. when hovered over it in a UI. + # Corresponds to the JSON property `description` + # @return [String] + attr_accessor :description + + # Textual representation of an expression in Common Expression Language syntax. + # Corresponds to the JSON property `expression` + # @return [String] + attr_accessor :expression + + # Optional. String indicating the location of the expression for error reporting, + # e.g. a file name and a position in the file. + # Corresponds to the JSON property `location` + # @return [String] + attr_accessor :location + + # 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. + # Corresponds to the JSON property `title` + # @return [String] + attr_accessor :title + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @description = args[:description] if args.key?(:description) + @expression = args[:expression] if args.key?(:expression) + @location = args[:location] if args.key?(:location) + @title = args[:title] if args.key?(:title) + end + end + + # Request message for `GetIamPolicy` method. + class GetIamPolicyRequest + include Google::Apis::Core::Hashable + + # Encapsulates settings provided to GetIamPolicy. + # Corresponds to the JSON property `options` + # @return [Google::Apis::BigquerydatapolicyV2::GetPolicyOptions] + attr_accessor :options + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @options = args[:options] if args.key?(:options) + end + end + + # Encapsulates settings provided to GetIamPolicy. + class GetPolicyOptions + include Google::Apis::Core::Hashable + + # Optional. The maximum policy version that will be used to format the policy. + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. Requests for policies with any conditional role bindings must + # specify version 3. Policies with no conditional role bindings may specify any + # valid value or leave the field unset. The policy in the response might use the + # policy version that you specified, or it might use a lower policy version. For + # example, if you specify version 3, but the policy has no conditional role + # bindings, the response uses version 1. To learn which resources support + # conditions in their IAM policies, see the [IAM documentation](https://cloud. + # google.com/iam/help/conditions/resource-policies). + # Corresponds to the JSON property `requestedPolicyVersion` + # @return [Fixnum] + attr_accessor :requested_policy_version + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version) + end + end + + # Response message for the ListDataPolicies method. + class ListDataPoliciesResponse + include Google::Apis::Core::Hashable + + # Data policies that belong to the requested project. + # Corresponds to the JSON property `dataPolicies` + # @return [Array] + attr_accessor :data_policies + + # Token used to retrieve the next page of results, or empty if there are no more + # results. + # Corresponds to the JSON property `nextPageToken` + # @return [String] + attr_accessor :next_page_token + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @data_policies = args[:data_policies] if args.key?(:data_policies) + @next_page_token = args[:next_page_token] if args.key?(:next_page_token) + end + end + + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. A `Policy` is a collection of `bindings`. + # A `binding` binds one or more `members`, or principals, to a single `role`. + # Principals can be user accounts, service accounts, Google groups, and domains ( + # such as G Suite). A `role` is a named list of permissions; each `role` can be + # an IAM predefined role or a user-created custom role. For some types of Google + # Cloud resources, a `binding` can also specify a `condition`, which is a + # logical expression that allows access to a resource only if the expression + # evaluates to `true`. A condition can add constraints based on attributes of + # the request, the resource, or both. To learn which resources support + # conditions in their IAM policies, see the [IAM documentation](https://cloud. + # google.com/iam/help/conditions/resource-policies). **JSON example:** ``` ` " + # bindings": [ ` "role": "roles/resourcemanager.organizationAdmin", "members": [ + # "user:mike@example.com", "group:admins@example.com", "domain:google.com", " + # serviceAccount:my-project-id@appspot.gserviceaccount.com" ] `, ` "role": " + # roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" + # ], "condition": ` "title": "expirable access", "description": "Does not grant + # access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00: + # 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` ``` **YAML + # example:** ``` bindings: - members: - user:mike@example.com - group:admins@ + # example.com - domain:google.com - serviceAccount:my-project-id@appspot. + # gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - + # user:eve@example.com role: roles/resourcemanager.organizationViewer condition: + # title: expirable access description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: + # BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + class Policy + include Google::Apis::Core::Hashable + + # Specifies cloud audit logging configuration for this policy. + # Corresponds to the JSON property `auditConfigs` + # @return [Array] + attr_accessor :audit_configs + + # Associates a list of `members`, or principals, with a `role`. Optionally, may + # specify a `condition` that determines how and when the `bindings` are applied. + # Each of the `bindings` must contain at least one principal. The `bindings` in + # a `Policy` can refer to up to 1,500 principals; up to 250 of these principals + # can be Google groups. Each occurrence of a principal counts towards these + # limits. For example, if the `bindings` grant 50 different roles to `user:alice@ + # example.com`, and not to any other principal, then you can add another 1,450 + # principals to the `bindings` in the `Policy`. + # Corresponds to the JSON property `bindings` + # @return [Array] + attr_accessor :bindings + + # `etag` is used for optimistic concurrency control as a way to help prevent + # simultaneous updates of a policy from overwriting each other. It is strongly + # suggested that systems make use of the `etag` in the read-modify-write cycle + # to perform policy updates in order to avoid race conditions: An `etag` is + # returned in the response to `getIamPolicy`, and systems are expected to put + # that etag in the request to `setIamPolicy` to ensure that their change will be + # applied to the same version of the policy. **Important:** If you use IAM + # Conditions, you must include the `etag` field whenever you call `setIamPolicy`. + # If you omit this field, then IAM allows you to overwrite a version `3` policy + # with a version `1` policy, and all of the conditions in the version `3` policy + # are lost. + # Corresponds to the JSON property `etag` + # NOTE: Values are automatically base64 encoded/decoded in the client library. + # @return [String] + attr_accessor :etag + + # Specifies the format of the policy. Valid values are `0`, `1`, and `3`. + # Requests that specify an invalid value are rejected. Any operation that + # affects conditional role bindings must specify version `3`. This requirement + # applies to the following operations: * Getting a policy that includes a + # conditional role binding * Adding a conditional role binding to a policy * + # Changing a conditional role binding in a policy * Removing any role binding, + # with or without a condition, from a policy that includes conditions ** + # Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows you + # to overwrite a version `3` policy with a version `1` policy, and all of the + # conditions in the version `3` policy are lost. If a policy does not include + # any conditions, operations on that policy may specify any valid version or + # leave the field unset. To learn which resources support conditions in their + # IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/ + # conditions/resource-policies). + # Corresponds to the JSON property `version` + # @return [Fixnum] + attr_accessor :version + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @audit_configs = args[:audit_configs] if args.key?(:audit_configs) + @bindings = args[:bindings] if args.key?(:bindings) + @etag = args[:etag] if args.key?(:etag) + @version = args[:version] if args.key?(:version) + end + end + + # Request message for the RemoveGrantees method. + class RemoveGranteesRequest + include Google::Apis::Core::Hashable + + # Required. IAM principal that should be revoked from Fine Grained Access to the + # underlying data goverened by the data policy. The target data policy is + # determined by the `data_policy` field. Uses the [IAM V2 principal syntax]( + # https://cloud.google.com/iam/docs/principal-identifiers#v2). Supported + # principal types: * User * Group * Service account + # Corresponds to the JSON property `grantees` + # @return [Array] + attr_accessor :grantees + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @grantees = args[:grantees] if args.key?(:grantees) + end + end + + # Request message for `SetIamPolicy` method. + class SetIamPolicyRequest + include Google::Apis::Core::Hashable + + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. A `Policy` is a collection of `bindings`. + # A `binding` binds one or more `members`, or principals, to a single `role`. + # Principals can be user accounts, service accounts, Google groups, and domains ( + # such as G Suite). A `role` is a named list of permissions; each `role` can be + # an IAM predefined role or a user-created custom role. For some types of Google + # Cloud resources, a `binding` can also specify a `condition`, which is a + # logical expression that allows access to a resource only if the expression + # evaluates to `true`. A condition can add constraints based on attributes of + # the request, the resource, or both. To learn which resources support + # conditions in their IAM policies, see the [IAM documentation](https://cloud. + # google.com/iam/help/conditions/resource-policies). **JSON example:** ``` ` " + # bindings": [ ` "role": "roles/resourcemanager.organizationAdmin", "members": [ + # "user:mike@example.com", "group:admins@example.com", "domain:google.com", " + # serviceAccount:my-project-id@appspot.gserviceaccount.com" ] `, ` "role": " + # roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" + # ], "condition": ` "title": "expirable access", "description": "Does not grant + # access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00: + # 00:00.000Z')", ` ` ], "etag": "BwWWja0YfJA=", "version": 3 ` ``` **YAML + # example:** ``` bindings: - members: - user:mike@example.com - group:admins@ + # example.com - domain:google.com - serviceAccount:my-project-id@appspot. + # gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - + # user:eve@example.com role: roles/resourcemanager.organizationViewer condition: + # title: expirable access description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: + # BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # Corresponds to the JSON property `policy` + # @return [Google::Apis::BigquerydatapolicyV2::Policy] + attr_accessor :policy + + # 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"` + # Corresponds to the JSON property `updateMask` + # @return [String] + attr_accessor :update_mask + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @policy = args[:policy] if args.key?(:policy) + @update_mask = args[:update_mask] if args.key?(:update_mask) + end + end + + # Request message for `TestIamPermissions` method. + class TestIamPermissionsRequest + include Google::Apis::Core::Hashable + + # 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). + # Corresponds to the JSON property `permissions` + # @return [Array] + attr_accessor :permissions + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @permissions = args[:permissions] if args.key?(:permissions) + end + end + + # Response message for `TestIamPermissions` method. + class TestIamPermissionsResponse + include Google::Apis::Core::Hashable + + # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + # Corresponds to the JSON property `permissions` + # @return [Array] + attr_accessor :permissions + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @permissions = args[:permissions] if args.key?(:permissions) + end + end + end + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/gem_version.rb b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/gem_version.rb new file mode 100644 index 00000000000..126ef8f260e --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/gem_version.rb @@ -0,0 +1,28 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module Google + module Apis + module BigquerydatapolicyV2 + # Version of the google-apis-bigquerydatapolicy_v2 gem + GEM_VERSION = "0.1.0" + + # Version of the code generator used to generate this client + GENERATOR_VERSION = "0.18.0" + + # Revision of the discovery document this client was generated from + REVISION = "20251001" + end + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/representations.rb b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/representations.rb new file mode 100644 index 00000000000..8cea31219d0 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/representations.rb @@ -0,0 +1,276 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'date' +require 'google/apis/core/base_service' +require 'google/apis/core/json_representation' +require 'google/apis/core/hashable' +require 'google/apis/errors' + +module Google + module Apis + module BigquerydatapolicyV2 + + class AddGranteesRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class AuditConfig + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class AuditLogConfig + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class Binding + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class CreateDataPolicyRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class DataMaskingPolicy + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class DataPolicy + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class Empty + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class Expr + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GetIamPolicyRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class GetPolicyOptions + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class ListDataPoliciesResponse + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class Policy + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class RemoveGranteesRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class SetIamPolicyRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class TestIamPermissionsRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class TestIamPermissionsResponse + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class AddGranteesRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :grantees, as: 'grantees' + end + end + + class AuditConfig + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::BigquerydatapolicyV2::AuditLogConfig, decorator: Google::Apis::BigquerydatapolicyV2::AuditLogConfig::Representation + + property :service, as: 'service' + end + end + + class AuditLogConfig + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :exempted_members, as: 'exemptedMembers' + property :log_type, as: 'logType' + end + end + + class Binding + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :condition, as: 'condition', class: Google::Apis::BigquerydatapolicyV2::Expr, decorator: Google::Apis::BigquerydatapolicyV2::Expr::Representation + + collection :members, as: 'members' + property :role, as: 'role' + end + end + + class CreateDataPolicyRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :data_policy, as: 'dataPolicy', class: Google::Apis::BigquerydatapolicyV2::DataPolicy, decorator: Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + + property :data_policy_id, as: 'dataPolicyId' + end + end + + class DataMaskingPolicy + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :predefined_expression, as: 'predefinedExpression' + property :routine, as: 'routine' + end + end + + class DataPolicy + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :data_masking_policy, as: 'dataMaskingPolicy', class: Google::Apis::BigquerydatapolicyV2::DataMaskingPolicy, decorator: Google::Apis::BigquerydatapolicyV2::DataMaskingPolicy::Representation + + property :data_policy_id, as: 'dataPolicyId' + property :data_policy_type, as: 'dataPolicyType' + property :etag, as: 'etag' + collection :grantees, as: 'grantees' + property :name, as: 'name' + property :policy_tag, as: 'policyTag' + property :version, as: 'version' + end + end + + class Empty + # @private + class Representation < Google::Apis::Core::JsonRepresentation + end + end + + class Expr + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :description, as: 'description' + property :expression, as: 'expression' + property :location, as: 'location' + property :title, as: 'title' + end + end + + class GetIamPolicyRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :options, as: 'options', class: Google::Apis::BigquerydatapolicyV2::GetPolicyOptions, decorator: Google::Apis::BigquerydatapolicyV2::GetPolicyOptions::Representation + + end + end + + class GetPolicyOptions + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :requested_policy_version, as: 'requestedPolicyVersion' + end + end + + class ListDataPoliciesResponse + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :data_policies, as: 'dataPolicies', class: Google::Apis::BigquerydatapolicyV2::DataPolicy, decorator: Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + + property :next_page_token, as: 'nextPageToken' + end + end + + class Policy + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :audit_configs, as: 'auditConfigs', class: Google::Apis::BigquerydatapolicyV2::AuditConfig, decorator: Google::Apis::BigquerydatapolicyV2::AuditConfig::Representation + + collection :bindings, as: 'bindings', class: Google::Apis::BigquerydatapolicyV2::Binding, decorator: Google::Apis::BigquerydatapolicyV2::Binding::Representation + + property :etag, :base64 => true, as: 'etag' + property :version, as: 'version' + end + end + + class RemoveGranteesRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :grantees, as: 'grantees' + end + end + + class SetIamPolicyRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :policy, as: 'policy', class: Google::Apis::BigquerydatapolicyV2::Policy, decorator: Google::Apis::BigquerydatapolicyV2::Policy::Representation + + property :update_mask, as: 'updateMask' + end + end + + class TestIamPermissionsRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :permissions, as: 'permissions' + end + end + + class TestIamPermissionsResponse + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :permissions, as: 'permissions' + end + end + end + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/service.rb b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/service.rb new file mode 100644 index 00000000000..572b1d82c2c --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/lib/google/apis/bigquerydatapolicy_v2/service.rb @@ -0,0 +1,431 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'google/apis/core/base_service' +require 'google/apis/core/json_representation' +require 'google/apis/core/hashable' +require 'google/apis/errors' + +module Google + module Apis + module BigquerydatapolicyV2 + # BigQuery Data Policy API + # + # Allows users to manage BigQuery data policies. + # + # @example + # require 'google/apis/bigquerydatapolicy_v2' + # + # Bigquerydatapolicy = Google::Apis::BigquerydatapolicyV2 # Alias the module + # service = Bigquerydatapolicy::BigQueryDataPolicyServiceService.new + # + # @see https://cloud.google.com/bigquery/docs/column-data-masking + class BigQueryDataPolicyServiceService < Google::Apis::Core::BaseService + DEFAULT_ENDPOINT_TEMPLATE = "https://bigquerydatapolicy.$UNIVERSE_DOMAIN$/" + + # @return [String] + # API key. Your API key identifies your project and provides you with API access, + # quota, and reports. Required unless you provide an OAuth 2.0 token. + attr_accessor :key + + # @return [String] + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + attr_accessor :quota_user + + def initialize + super(DEFAULT_ENDPOINT_TEMPLATE, '', + client_name: 'google-apis-bigquerydatapolicy_v2', + client_version: Google::Apis::BigquerydatapolicyV2::GEM_VERSION) + @batch_path = 'batch' + end + + # Adds new grantees to a data policy. The new grantees will be added to the + # existing grantees. If the request contains a duplicate grantee, the grantee + # will be ignored. If the request contains a grantee that already exists, the + # grantee will be ignored. + # @param [String] data_policy + # Required. Resource name of this data policy, in the format of `projects/` + # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``. + # @param [Google::Apis::BigquerydatapolicyV2::AddGranteesRequest] add_grantees_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def add_data_policy_grantees(data_policy, add_grantees_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+dataPolicy}:addGrantees', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::AddGranteesRequest::Representation + command.request_object = add_grantees_request_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy + command.params['dataPolicy'] = data_policy unless data_policy.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Creates a new data policy under a project with the given `data_policy_id` ( + # used as the display name), and data policy type. + # @param [String] parent + # Required. Resource name of the project that the data policy will belong to. + # The format is `projects/`project_number`/locations/`location_id``. + # @param [Google::Apis::BigquerydatapolicyV2::CreateDataPolicyRequest] create_data_policy_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def create_data_policy(parent, create_data_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+parent}/dataPolicies', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::CreateDataPolicyRequest::Representation + command.request_object = create_data_policy_request_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy + command.params['parent'] = parent unless parent.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Deletes the data policy specified by its resource name. + # @param [String] name + # Required. Resource name of the data policy to delete. Format is `projects/` + # project_number`/locations/`location_id`/dataPolicies/`id``. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::Empty] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::Empty] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def delete_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:delete, 'v2/{+name}', options) + command.response_representation = Google::Apis::BigquerydatapolicyV2::Empty::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::Empty + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Gets the data policy specified by its resource name. + # @param [String] name + # Required. Resource name of the requested data policy. Format is `projects/` + # project_number`/locations/`location_id`/dataPolicies/`id``. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def get_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v2/{+name}', options) + command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy + command.params['name'] = name unless name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Gets the IAM policy for the specified data policy. + # @param [String] resource + # REQUIRED: The resource for which the policy is being requested. See [Resource + # names](https://cloud.google.com/apis/design/resource_names) for the + # appropriate value for this field. + # @param [Google::Apis::BigquerydatapolicyV2::GetIamPolicyRequest] get_iam_policy_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::Policy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::Policy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def get_data_policy_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+resource}:getIamPolicy', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::GetIamPolicyRequest::Representation + command.request_object = get_iam_policy_request_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::Policy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::Policy + command.params['resource'] = resource unless resource.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # List all of the data policies in the specified parent project. + # @param [String] parent + # Required. Resource name of the project for which to list data policies. Format + # is `projects/`project_number`/locations/`location_id``. + # @param [String] filter + # Optional. Filters the data policies by policy tags that they are associated + # with. Currently filter only supports "policy_tag" based filtering and OR based + # predicates. Sample filter can be "policy_tag: projects/1/locations/us/ + # taxonomies/2/policyTags/3". You may also use wildcard such as "policy_tag: + # projects/1/locations/us/taxonomies/2*". Please note that OR predicates cannot + # be used with wildcard filters. + # @param [Fixnum] page_size + # Optional. The maximum number of data policies to return. Must be a value + # between 1 and 1000. If not set, defaults to 50. + # @param [String] page_token + # Optional. The `nextPageToken` value returned from a previous list request, if + # any. If not set, defaults to an empty string. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def list_project_location_data_policies(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:get, 'v2/{+parent}/dataPolicies', options) + command.response_representation = Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::ListDataPoliciesResponse + command.params['parent'] = parent unless parent.nil? + command.query['filter'] = filter unless filter.nil? + command.query['pageSize'] = page_size unless page_size.nil? + command.query['pageToken'] = page_token unless page_token.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Updates the metadata for an existing data policy. The target data policy can + # be specified by the resource name. + # @param [String] name + # Identifier. Resource name of this data policy, in the format of `projects/` + # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``. + # @param [Google::Apis::BigquerydatapolicyV2::DataPolicy] data_policy_object + # @param [Boolean] allow_missing + # Optional. If set to true, and the data policy is not found, a new data policy + # will be created. In this situation, update_mask is ignored. + # @param [String] update_mask + # Optional. The update mask applies to the resource. For the `FieldMask` + # definition, see https://developers.google.com/protocol-buffers/docs/reference/ + # google.protobuf#fieldmask If not set, defaults to all of the fields that are + # allowed to update. Updates to the `name` and `dataPolicyId` fields are not + # allowed. + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def patch_project_location_data_policy(name, data_policy_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:patch, 'v2/{+name}', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + command.request_object = data_policy_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy + command.params['name'] = name unless name.nil? + command.query['allowMissing'] = allow_missing unless allow_missing.nil? + command.query['updateMask'] = update_mask unless update_mask.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Removes grantees from a data policy. The grantees will be removed from the + # existing grantees. If the request contains a grantee that does not exist, the + # grantee will be ignored. + # @param [String] data_policy + # Required. Resource name of this data policy, in the format of `projects/` + # project_number`/locations/`location_id`/dataPolicies/`data_policy_id``. + # @param [Google::Apis::BigquerydatapolicyV2::RemoveGranteesRequest] remove_grantees_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::DataPolicy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::DataPolicy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def remove_data_policy_grantees(data_policy, remove_grantees_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+dataPolicy}:removeGrantees', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::RemoveGranteesRequest::Representation + command.request_object = remove_grantees_request_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::DataPolicy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::DataPolicy + command.params['dataPolicy'] = data_policy unless data_policy.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Sets the IAM policy for the specified data policy. + # @param [String] resource + # REQUIRED: The resource for which the policy is being specified. See [Resource + # names](https://cloud.google.com/apis/design/resource_names) for the + # appropriate value for this field. + # @param [Google::Apis::BigquerydatapolicyV2::SetIamPolicyRequest] set_iam_policy_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::Policy] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::Policy] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def set_data_policy_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+resource}:setIamPolicy', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::SetIamPolicyRequest::Representation + command.request_object = set_iam_policy_request_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::Policy::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::Policy + command.params['resource'] = resource unless resource.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + # Returns the caller's permission on the specified data policy resource. + # @param [String] resource + # REQUIRED: The resource for which the policy detail is being requested. See [ + # Resource names](https://cloud.google.com/apis/design/resource_names) for the + # appropriate value for this field. + # @param [Google::Apis::BigquerydatapolicyV2::TestIamPermissionsRequest] test_iam_permissions_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def test_data_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v2/{+resource}:testIamPermissions', options) + command.request_representation = Google::Apis::BigquerydatapolicyV2::TestIamPermissionsRequest::Representation + command.request_object = test_iam_permissions_request_object + command.response_representation = Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse::Representation + command.response_class = Google::Apis::BigquerydatapolicyV2::TestIamPermissionsResponse + command.params['resource'] = resource unless resource.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + + protected + + def apply_command_defaults(command) + command.query['key'] = key unless key.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + end + end + end + end +end diff --git a/generated/google-apis-bigquerydatapolicy_v2/spec/generated_spec.rb b/generated/google-apis-bigquerydatapolicy_v2/spec/generated_spec.rb new file mode 100644 index 00000000000..0c39f2c3615 --- /dev/null +++ b/generated/google-apis-bigquerydatapolicy_v2/spec/generated_spec.rb @@ -0,0 +1,27 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "rspec" + +RSpec.describe "Google::Apis::BigquerydatapolicyV2" do + # Minimal test just to ensure no syntax errors in generated code + it "should load" do + expect do + require "google/apis/bigquerydatapolicy_v2" + end.not_to raise_error + expect do + Google::Apis::BigquerydatapolicyV2::BigQueryDataPolicyServiceService.new + end.not_to raise_error + end +end