google-apis-bigquerydatapolicy_v1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google/apis/bigquerydatapolicy_v1/classes.rb +596 -0
- data/lib/google/apis/bigquerydatapolicy_v1/gem_version.rb +28 -0
- data/lib/google/apis/bigquerydatapolicy_v1/representations.rb +245 -0
- data/lib/google/apis/bigquerydatapolicy_v1/service.rb +385 -0
- data/lib/google/apis/bigquerydatapolicy_v1.rb +39 -0
- data/lib/google-apis-bigquerydatapolicy_v1.rb +15 -0
- metadata +82 -0
@@ -0,0 +1,245 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module BigquerydatapolicyV1
|
24
|
+
|
25
|
+
class AuditConfig
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class AuditLogConfig
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class Binding
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class DataMaskingPolicy
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class DataPolicy
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class Empty
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class Expr
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class GetIamPolicyRequest
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class GetPolicyOptions
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class ListDataPoliciesResponse
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class Policy
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
91
|
+
class RenameDataPolicyRequest
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
93
|
+
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
95
|
+
end
|
96
|
+
|
97
|
+
class SetIamPolicyRequest
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
99
|
+
|
100
|
+
include Google::Apis::Core::JsonObjectSupport
|
101
|
+
end
|
102
|
+
|
103
|
+
class TestIamPermissionsRequest
|
104
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
105
|
+
|
106
|
+
include Google::Apis::Core::JsonObjectSupport
|
107
|
+
end
|
108
|
+
|
109
|
+
class TestIamPermissionsResponse
|
110
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
111
|
+
|
112
|
+
include Google::Apis::Core::JsonObjectSupport
|
113
|
+
end
|
114
|
+
|
115
|
+
class AuditConfig
|
116
|
+
# @private
|
117
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
118
|
+
collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::BigquerydatapolicyV1::AuditLogConfig, decorator: Google::Apis::BigquerydatapolicyV1::AuditLogConfig::Representation
|
119
|
+
|
120
|
+
property :service, as: 'service'
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
class AuditLogConfig
|
125
|
+
# @private
|
126
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
127
|
+
collection :exempted_members, as: 'exemptedMembers'
|
128
|
+
property :log_type, as: 'logType'
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
class Binding
|
133
|
+
# @private
|
134
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
135
|
+
property :condition, as: 'condition', class: Google::Apis::BigquerydatapolicyV1::Expr, decorator: Google::Apis::BigquerydatapolicyV1::Expr::Representation
|
136
|
+
|
137
|
+
collection :members, as: 'members'
|
138
|
+
property :role, as: 'role'
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
class DataMaskingPolicy
|
143
|
+
# @private
|
144
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
145
|
+
property :predefined_expression, as: 'predefinedExpression'
|
146
|
+
property :routine, as: 'routine'
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
class DataPolicy
|
151
|
+
# @private
|
152
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
153
|
+
property :data_masking_policy, as: 'dataMaskingPolicy', class: Google::Apis::BigquerydatapolicyV1::DataMaskingPolicy, decorator: Google::Apis::BigquerydatapolicyV1::DataMaskingPolicy::Representation
|
154
|
+
|
155
|
+
property :data_policy_id, as: 'dataPolicyId'
|
156
|
+
property :data_policy_type, as: 'dataPolicyType'
|
157
|
+
property :name, as: 'name'
|
158
|
+
property :policy_tag, as: 'policyTag'
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
class Empty
|
163
|
+
# @private
|
164
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
class Expr
|
169
|
+
# @private
|
170
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
171
|
+
property :description, as: 'description'
|
172
|
+
property :expression, as: 'expression'
|
173
|
+
property :location, as: 'location'
|
174
|
+
property :title, as: 'title'
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
class GetIamPolicyRequest
|
179
|
+
# @private
|
180
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
181
|
+
property :options, as: 'options', class: Google::Apis::BigquerydatapolicyV1::GetPolicyOptions, decorator: Google::Apis::BigquerydatapolicyV1::GetPolicyOptions::Representation
|
182
|
+
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
class GetPolicyOptions
|
187
|
+
# @private
|
188
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
189
|
+
property :requested_policy_version, as: 'requestedPolicyVersion'
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
class ListDataPoliciesResponse
|
194
|
+
# @private
|
195
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
196
|
+
collection :data_policies, as: 'dataPolicies', class: Google::Apis::BigquerydatapolicyV1::DataPolicy, decorator: Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
197
|
+
|
198
|
+
property :next_page_token, as: 'nextPageToken'
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
class Policy
|
203
|
+
# @private
|
204
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
205
|
+
collection :audit_configs, as: 'auditConfigs', class: Google::Apis::BigquerydatapolicyV1::AuditConfig, decorator: Google::Apis::BigquerydatapolicyV1::AuditConfig::Representation
|
206
|
+
|
207
|
+
collection :bindings, as: 'bindings', class: Google::Apis::BigquerydatapolicyV1::Binding, decorator: Google::Apis::BigquerydatapolicyV1::Binding::Representation
|
208
|
+
|
209
|
+
property :etag, :base64 => true, as: 'etag'
|
210
|
+
property :version, as: 'version'
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
class RenameDataPolicyRequest
|
215
|
+
# @private
|
216
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
217
|
+
property :new_data_policy_id, as: 'newDataPolicyId'
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
class SetIamPolicyRequest
|
222
|
+
# @private
|
223
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
224
|
+
property :policy, as: 'policy', class: Google::Apis::BigquerydatapolicyV1::Policy, decorator: Google::Apis::BigquerydatapolicyV1::Policy::Representation
|
225
|
+
|
226
|
+
property :update_mask, as: 'updateMask'
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
class TestIamPermissionsRequest
|
231
|
+
# @private
|
232
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
233
|
+
collection :permissions, as: 'permissions'
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
class TestIamPermissionsResponse
|
238
|
+
# @private
|
239
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
240
|
+
collection :permissions, as: 'permissions'
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,385 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/core/base_service'
|
16
|
+
require 'google/apis/core/json_representation'
|
17
|
+
require 'google/apis/core/hashable'
|
18
|
+
require 'google/apis/errors'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
module BigquerydatapolicyV1
|
23
|
+
# BigQuery Data Policy API
|
24
|
+
#
|
25
|
+
# Allows users to manage BigQuery data policies.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/bigquerydatapolicy_v1'
|
29
|
+
#
|
30
|
+
# Bigquerydatapolicy = Google::Apis::BigquerydatapolicyV1 # Alias the module
|
31
|
+
# service = Bigquerydatapolicy::BigQueryDataPolicyServiceService.new
|
32
|
+
#
|
33
|
+
# @see https://cloud.google.com/bigquery/docs/column-data-masking
|
34
|
+
class BigQueryDataPolicyServiceService < Google::Apis::Core::BaseService
|
35
|
+
# @return [String]
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
38
|
+
attr_accessor :key
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
42
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
43
|
+
attr_accessor :quota_user
|
44
|
+
|
45
|
+
def initialize
|
46
|
+
super('https://bigquerydatapolicy.googleapis.com/', '',
|
47
|
+
client_name: 'google-apis-bigquerydatapolicy_v1',
|
48
|
+
client_version: Google::Apis::BigquerydatapolicyV1::GEM_VERSION)
|
49
|
+
@batch_path = 'batch'
|
50
|
+
end
|
51
|
+
|
52
|
+
# Creates a new data policy under a project with the given `dataPolicyId` (used
|
53
|
+
# as the display name), policy tag, and data policy type.
|
54
|
+
# @param [String] parent
|
55
|
+
# Required. Resource name of the project that the data policy will belong to.
|
56
|
+
# The format is `projects/`project_number`/locations/`location_id``.
|
57
|
+
# @param [Google::Apis::BigquerydatapolicyV1::DataPolicy] data_policy_object
|
58
|
+
# @param [String] fields
|
59
|
+
# Selector specifying which fields to include in a partial response.
|
60
|
+
# @param [String] quota_user
|
61
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
62
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
63
|
+
# @param [Google::Apis::RequestOptions] options
|
64
|
+
# Request-specific options
|
65
|
+
#
|
66
|
+
# @yield [result, err] Result & error if block supplied
|
67
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::DataPolicy] parsed result object
|
68
|
+
# @yieldparam err [StandardError] error object if request failed
|
69
|
+
#
|
70
|
+
# @return [Google::Apis::BigquerydatapolicyV1::DataPolicy]
|
71
|
+
#
|
72
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
73
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
74
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
75
|
+
def create_project_location_data_policy(parent, data_policy_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
76
|
+
command = make_simple_command(:post, 'v1/{+parent}/dataPolicies', options)
|
77
|
+
command.request_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
78
|
+
command.request_object = data_policy_object
|
79
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
80
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
|
81
|
+
command.params['parent'] = parent unless parent.nil?
|
82
|
+
command.query['fields'] = fields unless fields.nil?
|
83
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
84
|
+
execute_or_queue_command(command, &block)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Deletes the data policy specified by its resource name.
|
88
|
+
# @param [String] name
|
89
|
+
# Required. Resource name of the data policy to delete. Format is `projects/`
|
90
|
+
# project_number`/locations/`location_id`/dataPolicies/`data_policy_id``.
|
91
|
+
# @param [String] fields
|
92
|
+
# Selector specifying which fields to include in a partial response.
|
93
|
+
# @param [String] quota_user
|
94
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
95
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
96
|
+
# @param [Google::Apis::RequestOptions] options
|
97
|
+
# Request-specific options
|
98
|
+
#
|
99
|
+
# @yield [result, err] Result & error if block supplied
|
100
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::Empty] parsed result object
|
101
|
+
# @yieldparam err [StandardError] error object if request failed
|
102
|
+
#
|
103
|
+
# @return [Google::Apis::BigquerydatapolicyV1::Empty]
|
104
|
+
#
|
105
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
106
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
107
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
108
|
+
def delete_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block)
|
109
|
+
command = make_simple_command(:delete, 'v1/{+name}', options)
|
110
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::Empty::Representation
|
111
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::Empty
|
112
|
+
command.params['name'] = name unless name.nil?
|
113
|
+
command.query['fields'] = fields unless fields.nil?
|
114
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
115
|
+
execute_or_queue_command(command, &block)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Gets the data policy specified by its resource name.
|
119
|
+
# @param [String] name
|
120
|
+
# Required. Resource name of the requested data policy. Format is `projects/`
|
121
|
+
# project_number`/locations/`location_id`/dataPolicies/`data_policy_id``.
|
122
|
+
# @param [String] fields
|
123
|
+
# Selector specifying which fields to include in a partial response.
|
124
|
+
# @param [String] quota_user
|
125
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
126
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
127
|
+
# @param [Google::Apis::RequestOptions] options
|
128
|
+
# Request-specific options
|
129
|
+
#
|
130
|
+
# @yield [result, err] Result & error if block supplied
|
131
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::DataPolicy] parsed result object
|
132
|
+
# @yieldparam err [StandardError] error object if request failed
|
133
|
+
#
|
134
|
+
# @return [Google::Apis::BigquerydatapolicyV1::DataPolicy]
|
135
|
+
#
|
136
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
137
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
138
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
139
|
+
def get_project_location_data_policy(name, fields: nil, quota_user: nil, options: nil, &block)
|
140
|
+
command = make_simple_command(:get, 'v1/{+name}', options)
|
141
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
142
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
|
143
|
+
command.params['name'] = name unless name.nil?
|
144
|
+
command.query['fields'] = fields unless fields.nil?
|
145
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
146
|
+
execute_or_queue_command(command, &block)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Gets the IAM policy for the specified data policy.
|
150
|
+
# @param [String] resource
|
151
|
+
# REQUIRED: The resource for which the policy is being requested. See [Resource
|
152
|
+
# names](https://cloud.google.com/apis/design/resource_names) for the
|
153
|
+
# appropriate value for this field.
|
154
|
+
# @param [Google::Apis::BigquerydatapolicyV1::GetIamPolicyRequest] get_iam_policy_request_object
|
155
|
+
# @param [String] fields
|
156
|
+
# Selector specifying which fields to include in a partial response.
|
157
|
+
# @param [String] quota_user
|
158
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
159
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
160
|
+
# @param [Google::Apis::RequestOptions] options
|
161
|
+
# Request-specific options
|
162
|
+
#
|
163
|
+
# @yield [result, err] Result & error if block supplied
|
164
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::Policy] parsed result object
|
165
|
+
# @yieldparam err [StandardError] error object if request failed
|
166
|
+
#
|
167
|
+
# @return [Google::Apis::BigquerydatapolicyV1::Policy]
|
168
|
+
#
|
169
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
170
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
171
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
172
|
+
def get_data_policy_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
173
|
+
command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
|
174
|
+
command.request_representation = Google::Apis::BigquerydatapolicyV1::GetIamPolicyRequest::Representation
|
175
|
+
command.request_object = get_iam_policy_request_object
|
176
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::Policy::Representation
|
177
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::Policy
|
178
|
+
command.params['resource'] = resource unless resource.nil?
|
179
|
+
command.query['fields'] = fields unless fields.nil?
|
180
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
181
|
+
execute_or_queue_command(command, &block)
|
182
|
+
end
|
183
|
+
|
184
|
+
# List all of the data policies in the specified parent project.
|
185
|
+
# @param [String] parent
|
186
|
+
# Required. Resource name of the project for which to list data policies. Format
|
187
|
+
# is `projects/`project_number`/locations/`location_id``.
|
188
|
+
# @param [String] filter
|
189
|
+
# Filters the data policies by policy tags that they are associated with.
|
190
|
+
# Currently filter only supports "policy_tag" based filtering and OR based
|
191
|
+
# predicates. Sample filter can be "policy_tag: projects/1/locations/us/
|
192
|
+
# taxonomies/2/policyTags/3". You may also use wildcard such as "policy_tag:
|
193
|
+
# projects/1/locations/us/taxonomies/2*". Please note that OR predicates cannot
|
194
|
+
# be used with wildcard filters.
|
195
|
+
# @param [Fixnum] page_size
|
196
|
+
# The maximum number of data policies to return. Must be a value between 1 and
|
197
|
+
# 1000. If not set, defaults to 50.
|
198
|
+
# @param [String] page_token
|
199
|
+
# The `nextPageToken` value returned from a previous list request, if any. If
|
200
|
+
# not set, defaults to an empty string.
|
201
|
+
# @param [String] fields
|
202
|
+
# Selector specifying which fields to include in a partial response.
|
203
|
+
# @param [String] quota_user
|
204
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
205
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
206
|
+
# @param [Google::Apis::RequestOptions] options
|
207
|
+
# Request-specific options
|
208
|
+
#
|
209
|
+
# @yield [result, err] Result & error if block supplied
|
210
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse] parsed result object
|
211
|
+
# @yieldparam err [StandardError] error object if request failed
|
212
|
+
#
|
213
|
+
# @return [Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse]
|
214
|
+
#
|
215
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
216
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
217
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
218
|
+
def list_project_location_data_policies(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
219
|
+
command = make_simple_command(:get, 'v1/{+parent}/dataPolicies', options)
|
220
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse::Representation
|
221
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::ListDataPoliciesResponse
|
222
|
+
command.params['parent'] = parent unless parent.nil?
|
223
|
+
command.query['filter'] = filter unless filter.nil?
|
224
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
225
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
226
|
+
command.query['fields'] = fields unless fields.nil?
|
227
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
228
|
+
execute_or_queue_command(command, &block)
|
229
|
+
end
|
230
|
+
|
231
|
+
# Updates the metadata for an existing data policy. The target data policy can
|
232
|
+
# be specified by the resource name.
|
233
|
+
# @param [String] name
|
234
|
+
# Output only. Resource name of this data policy, in the format of `projects/`
|
235
|
+
# project_number`/locations/`location_id`/dataPolicies/`data_policy_id``.
|
236
|
+
# @param [Google::Apis::BigquerydatapolicyV1::DataPolicy] data_policy_object
|
237
|
+
# @param [String] update_mask
|
238
|
+
# The update mask applies to the resource. For the `FieldMask` definition, see
|
239
|
+
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
|
240
|
+
# fieldmask If not set, defaults to all of the fields that are allowed to update.
|
241
|
+
# Updates to the `name` and `dataPolicyId` fields are not allowed.
|
242
|
+
# @param [String] fields
|
243
|
+
# Selector specifying which fields to include in a partial response.
|
244
|
+
# @param [String] quota_user
|
245
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
246
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
247
|
+
# @param [Google::Apis::RequestOptions] options
|
248
|
+
# Request-specific options
|
249
|
+
#
|
250
|
+
# @yield [result, err] Result & error if block supplied
|
251
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::DataPolicy] parsed result object
|
252
|
+
# @yieldparam err [StandardError] error object if request failed
|
253
|
+
#
|
254
|
+
# @return [Google::Apis::BigquerydatapolicyV1::DataPolicy]
|
255
|
+
#
|
256
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
257
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
258
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
259
|
+
def patch_project_location_data_policy(name, data_policy_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
|
260
|
+
command = make_simple_command(:patch, 'v1/{+name}', options)
|
261
|
+
command.request_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
262
|
+
command.request_object = data_policy_object
|
263
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
264
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
|
265
|
+
command.params['name'] = name unless name.nil?
|
266
|
+
command.query['updateMask'] = update_mask unless update_mask.nil?
|
267
|
+
command.query['fields'] = fields unless fields.nil?
|
268
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
269
|
+
execute_or_queue_command(command, &block)
|
270
|
+
end
|
271
|
+
|
272
|
+
# Renames the id (display name) of the specified data policy.
|
273
|
+
# @param [String] name
|
274
|
+
# Required. Resource name of the data policy to rename. The format is `projects/`
|
275
|
+
# project_number`/locations/`location_id`/dataPolicies/`data_policy_id``
|
276
|
+
# @param [Google::Apis::BigquerydatapolicyV1::RenameDataPolicyRequest] rename_data_policy_request_object
|
277
|
+
# @param [String] fields
|
278
|
+
# Selector specifying which fields to include in a partial response.
|
279
|
+
# @param [String] quota_user
|
280
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
281
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
282
|
+
# @param [Google::Apis::RequestOptions] options
|
283
|
+
# Request-specific options
|
284
|
+
#
|
285
|
+
# @yield [result, err] Result & error if block supplied
|
286
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::DataPolicy] parsed result object
|
287
|
+
# @yieldparam err [StandardError] error object if request failed
|
288
|
+
#
|
289
|
+
# @return [Google::Apis::BigquerydatapolicyV1::DataPolicy]
|
290
|
+
#
|
291
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
292
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
293
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
294
|
+
def rename_data_policy(name, rename_data_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
295
|
+
command = make_simple_command(:post, 'v1/{+name}:rename', options)
|
296
|
+
command.request_representation = Google::Apis::BigquerydatapolicyV1::RenameDataPolicyRequest::Representation
|
297
|
+
command.request_object = rename_data_policy_request_object
|
298
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::DataPolicy::Representation
|
299
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::DataPolicy
|
300
|
+
command.params['name'] = name unless name.nil?
|
301
|
+
command.query['fields'] = fields unless fields.nil?
|
302
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
303
|
+
execute_or_queue_command(command, &block)
|
304
|
+
end
|
305
|
+
|
306
|
+
# Sets the IAM policy for the specified data policy.
|
307
|
+
# @param [String] resource
|
308
|
+
# REQUIRED: The resource for which the policy is being specified. See [Resource
|
309
|
+
# names](https://cloud.google.com/apis/design/resource_names) for the
|
310
|
+
# appropriate value for this field.
|
311
|
+
# @param [Google::Apis::BigquerydatapolicyV1::SetIamPolicyRequest] set_iam_policy_request_object
|
312
|
+
# @param [String] fields
|
313
|
+
# Selector specifying which fields to include in a partial response.
|
314
|
+
# @param [String] quota_user
|
315
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
316
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
317
|
+
# @param [Google::Apis::RequestOptions] options
|
318
|
+
# Request-specific options
|
319
|
+
#
|
320
|
+
# @yield [result, err] Result & error if block supplied
|
321
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::Policy] parsed result object
|
322
|
+
# @yieldparam err [StandardError] error object if request failed
|
323
|
+
#
|
324
|
+
# @return [Google::Apis::BigquerydatapolicyV1::Policy]
|
325
|
+
#
|
326
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
327
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
328
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
329
|
+
def set_data_policy_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
330
|
+
command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
|
331
|
+
command.request_representation = Google::Apis::BigquerydatapolicyV1::SetIamPolicyRequest::Representation
|
332
|
+
command.request_object = set_iam_policy_request_object
|
333
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::Policy::Representation
|
334
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::Policy
|
335
|
+
command.params['resource'] = resource unless resource.nil?
|
336
|
+
command.query['fields'] = fields unless fields.nil?
|
337
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
338
|
+
execute_or_queue_command(command, &block)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Returns the caller's permission on the specified data policy resource.
|
342
|
+
# @param [String] resource
|
343
|
+
# REQUIRED: The resource for which the policy detail is being requested. See [
|
344
|
+
# Resource names](https://cloud.google.com/apis/design/resource_names) for the
|
345
|
+
# appropriate value for this field.
|
346
|
+
# @param [Google::Apis::BigquerydatapolicyV1::TestIamPermissionsRequest] test_iam_permissions_request_object
|
347
|
+
# @param [String] fields
|
348
|
+
# Selector specifying which fields to include in a partial response.
|
349
|
+
# @param [String] quota_user
|
350
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
351
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
352
|
+
# @param [Google::Apis::RequestOptions] options
|
353
|
+
# Request-specific options
|
354
|
+
#
|
355
|
+
# @yield [result, err] Result & error if block supplied
|
356
|
+
# @yieldparam result [Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse] parsed result object
|
357
|
+
# @yieldparam err [StandardError] error object if request failed
|
358
|
+
#
|
359
|
+
# @return [Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse]
|
360
|
+
#
|
361
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
362
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
363
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
364
|
+
def test_data_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
365
|
+
command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
|
366
|
+
command.request_representation = Google::Apis::BigquerydatapolicyV1::TestIamPermissionsRequest::Representation
|
367
|
+
command.request_object = test_iam_permissions_request_object
|
368
|
+
command.response_representation = Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse::Representation
|
369
|
+
command.response_class = Google::Apis::BigquerydatapolicyV1::TestIamPermissionsResponse
|
370
|
+
command.params['resource'] = resource unless resource.nil?
|
371
|
+
command.query['fields'] = fields unless fields.nil?
|
372
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
373
|
+
execute_or_queue_command(command, &block)
|
374
|
+
end
|
375
|
+
|
376
|
+
protected
|
377
|
+
|
378
|
+
def apply_command_defaults(command)
|
379
|
+
command.query['key'] = key unless key.nil?
|
380
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
end
|
385
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/bigquerydatapolicy_v1/service.rb'
|
16
|
+
require 'google/apis/bigquerydatapolicy_v1/classes.rb'
|
17
|
+
require 'google/apis/bigquerydatapolicy_v1/representations.rb'
|
18
|
+
require 'google/apis/bigquerydatapolicy_v1/gem_version.rb'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
# BigQuery Data Policy API
|
23
|
+
#
|
24
|
+
# Allows users to manage BigQuery data policies.
|
25
|
+
#
|
26
|
+
# @see https://cloud.google.com/bigquery/docs/column-data-masking
|
27
|
+
module BigquerydatapolicyV1
|
28
|
+
# Version of the BigQuery Data Policy API this client connects to.
|
29
|
+
# This is NOT the gem version.
|
30
|
+
VERSION = 'V1'
|
31
|
+
|
32
|
+
# View and manage your data in Google BigQuery and see the email address for your Google Account
|
33
|
+
AUTH_BIGQUERY = 'https://www.googleapis.com/auth/bigquery'
|
34
|
+
|
35
|
+
# See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
36
|
+
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|