google-cloud-bigquery 0.28.0 → 0.29.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 +4 -4
- data/README.md +1 -1
- data/lib/google-cloud-bigquery.rb +2 -2
- data/lib/google/cloud/bigquery.rb +10 -12
- data/lib/google/cloud/bigquery/copy_job.rb +42 -6
- data/lib/google/cloud/bigquery/data.rb +129 -23
- data/lib/google/cloud/bigquery/dataset.rb +708 -66
- data/lib/google/cloud/bigquery/dataset/access.rb +533 -27
- data/lib/google/cloud/bigquery/dataset/list.rb +5 -3
- data/lib/google/cloud/bigquery/external.rb +2353 -0
- data/lib/google/cloud/bigquery/extract_job.rb +52 -11
- data/lib/google/cloud/bigquery/insert_response.rb +90 -2
- data/lib/google/cloud/bigquery/job.rb +160 -21
- data/lib/google/cloud/bigquery/load_job.rb +128 -11
- data/lib/google/cloud/bigquery/project.rb +187 -44
- data/lib/google/cloud/bigquery/query_job.rb +323 -13
- data/lib/google/cloud/bigquery/schema.rb +57 -1
- data/lib/google/cloud/bigquery/schema/field.rb +118 -17
- data/lib/google/cloud/bigquery/service.rb +196 -43
- data/lib/google/cloud/bigquery/table.rb +739 -49
- data/lib/google/cloud/bigquery/table/async_inserter.rb +280 -0
- data/lib/google/cloud/bigquery/version.rb +1 -1
- data/lib/google/cloud/bigquery/view.rb +306 -69
- metadata +18 -3
- data/lib/google/cloud/bigquery/query_data.rb +0 -234
@@ -20,10 +20,10 @@ module Google
|
|
20
20
|
##
|
21
21
|
# # Dataset Access Control
|
22
22
|
#
|
23
|
-
# Represents the
|
23
|
+
# Represents the access control rules for a {Dataset}.
|
24
24
|
#
|
25
|
-
# @see https://cloud.google.com/bigquery/access-control BigQuery
|
26
|
-
# Control
|
25
|
+
# @see https://cloud.google.com/bigquery/docs/access-control BigQuery
|
26
|
+
# Access Control
|
27
27
|
#
|
28
28
|
# @example
|
29
29
|
# require "google/cloud/bigquery"
|
@@ -106,258 +106,764 @@ module Google
|
|
106
106
|
|
107
107
|
##
|
108
108
|
# Add reader access to a user.
|
109
|
+
#
|
110
|
+
# @param [String] email The email address for the entity.
|
111
|
+
#
|
112
|
+
# @example
|
113
|
+
# require "google/cloud/bigquery"
|
114
|
+
#
|
115
|
+
# bigquery = Google::Cloud::Bigquery.new
|
116
|
+
# dataset = bigquery.dataset "my_dataset"
|
117
|
+
#
|
118
|
+
# dataset.access do |access|
|
119
|
+
# access.add_reader_user "entity@example.com"
|
120
|
+
# end
|
121
|
+
#
|
109
122
|
def add_reader_user email
|
110
123
|
add_access_role_scope_value :reader, :user, email
|
111
124
|
end
|
112
125
|
|
113
126
|
##
|
114
127
|
# Add reader access to a group.
|
128
|
+
#
|
129
|
+
# @param [String] email The email address for the entity.
|
130
|
+
#
|
131
|
+
# @example
|
132
|
+
# require "google/cloud/bigquery"
|
133
|
+
#
|
134
|
+
# bigquery = Google::Cloud::Bigquery.new
|
135
|
+
# dataset = bigquery.dataset "my_dataset"
|
136
|
+
#
|
137
|
+
# dataset.access do |access|
|
138
|
+
# access.add_reader_group "entity@example.com"
|
139
|
+
# end
|
140
|
+
#
|
115
141
|
def add_reader_group email
|
116
142
|
add_access_role_scope_value :reader, :group, email
|
117
143
|
end
|
118
144
|
|
119
145
|
##
|
120
146
|
# Add reader access to a domain.
|
147
|
+
#
|
148
|
+
# @param [String] domain A [Cloud Identity
|
149
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
150
|
+
#
|
151
|
+
# @example
|
152
|
+
# require "google/cloud/bigquery"
|
153
|
+
#
|
154
|
+
# bigquery = Google::Cloud::Bigquery.new
|
155
|
+
# dataset = bigquery.dataset "my_dataset"
|
156
|
+
#
|
157
|
+
# dataset.access do |access|
|
158
|
+
# access.add_reader_domain "example.com"
|
159
|
+
# end
|
160
|
+
#
|
121
161
|
def add_reader_domain domain
|
122
162
|
add_access_role_scope_value :reader, :domain, domain
|
123
163
|
end
|
124
164
|
|
125
165
|
##
|
126
166
|
# Add reader access to a special group.
|
127
|
-
#
|
167
|
+
#
|
168
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
169
|
+
# `readers`, and `all`.
|
170
|
+
#
|
171
|
+
# @example
|
172
|
+
# require "google/cloud/bigquery"
|
173
|
+
#
|
174
|
+
# bigquery = Google::Cloud::Bigquery.new
|
175
|
+
# dataset = bigquery.dataset "my_dataset"
|
176
|
+
#
|
177
|
+
# dataset.access do |access|
|
178
|
+
# access.add_reader_special :all
|
179
|
+
# end
|
180
|
+
#
|
128
181
|
def add_reader_special group
|
129
182
|
add_access_role_scope_value :reader, :special, group
|
130
183
|
end
|
131
184
|
|
132
185
|
##
|
133
186
|
# Add reader access to a view.
|
134
|
-
#
|
135
|
-
#
|
136
|
-
# [Query
|
137
|
-
#
|
138
|
-
#
|
187
|
+
#
|
188
|
+
# @param [Google::Cloud::Bigquery::View, String] view A view object or
|
189
|
+
# a string identifier as specified by the [Query
|
190
|
+
# Reference](https://cloud.google.com/bigquery/query-reference#from):
|
191
|
+
# `project_name:datasetId.tableId`.
|
192
|
+
#
|
193
|
+
# @example
|
194
|
+
# require "google/cloud/bigquery"
|
195
|
+
#
|
196
|
+
# bigquery = Google::Cloud::Bigquery.new
|
197
|
+
# dataset = bigquery.dataset "my_dataset"
|
198
|
+
# other_dataset = bigquery.dataset "my_other_dataset"
|
199
|
+
#
|
200
|
+
# view = other_dataset.table "my_view"
|
201
|
+
#
|
202
|
+
# dataset.access do |access|
|
203
|
+
# access.add_reader_view view
|
204
|
+
# end
|
205
|
+
#
|
139
206
|
def add_reader_view view
|
140
207
|
add_access_view view
|
141
208
|
end
|
142
209
|
|
143
210
|
##
|
144
211
|
# Add writer access to a user.
|
212
|
+
#
|
213
|
+
# @param [String] email The email address for the entity.
|
214
|
+
#
|
215
|
+
# @example
|
216
|
+
# require "google/cloud/bigquery"
|
217
|
+
#
|
218
|
+
# bigquery = Google::Cloud::Bigquery.new
|
219
|
+
# dataset = bigquery.dataset "my_dataset"
|
220
|
+
#
|
221
|
+
# dataset.access do |access|
|
222
|
+
# access.add_writer_user "entity@example.com"
|
223
|
+
# end
|
224
|
+
#
|
145
225
|
def add_writer_user email
|
146
226
|
add_access_role_scope_value :writer, :user, email
|
147
227
|
end
|
148
228
|
|
149
229
|
##
|
150
230
|
# Add writer access to a group.
|
231
|
+
#
|
232
|
+
# @param [String] email The email address for the entity.
|
233
|
+
#
|
234
|
+
# @example
|
235
|
+
# require "google/cloud/bigquery"
|
236
|
+
#
|
237
|
+
# bigquery = Google::Cloud::Bigquery.new
|
238
|
+
# dataset = bigquery.dataset "my_dataset"
|
239
|
+
#
|
240
|
+
# dataset.access do |access|
|
241
|
+
# access.add_writer_group "entity@example.com"
|
242
|
+
# end
|
243
|
+
#
|
151
244
|
def add_writer_group email
|
152
245
|
add_access_role_scope_value :writer, :group, email
|
153
246
|
end
|
154
247
|
|
155
248
|
##
|
156
249
|
# Add writer access to a domain.
|
250
|
+
#
|
251
|
+
# @param [String] domain A [Cloud Identity
|
252
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
253
|
+
#
|
254
|
+
# @example
|
255
|
+
# require "google/cloud/bigquery"
|
256
|
+
#
|
257
|
+
# bigquery = Google::Cloud::Bigquery.new
|
258
|
+
# dataset = bigquery.dataset "my_dataset"
|
259
|
+
#
|
260
|
+
# dataset.access do |access|
|
261
|
+
# access.add_writer_domain "example.com"
|
262
|
+
# end
|
263
|
+
#
|
157
264
|
def add_writer_domain domain
|
158
265
|
add_access_role_scope_value :writer, :domain, domain
|
159
266
|
end
|
160
267
|
|
161
268
|
##
|
162
269
|
# Add writer access to a special group.
|
163
|
-
#
|
270
|
+
#
|
271
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
272
|
+
# `readers`, and `all`.
|
273
|
+
#
|
274
|
+
# @example
|
275
|
+
# require "google/cloud/bigquery"
|
276
|
+
#
|
277
|
+
# bigquery = Google::Cloud::Bigquery.new
|
278
|
+
# dataset = bigquery.dataset "my_dataset"
|
279
|
+
#
|
280
|
+
# dataset.access do |access|
|
281
|
+
# access.add_writer_special :all
|
282
|
+
# end
|
283
|
+
#
|
164
284
|
def add_writer_special group
|
165
285
|
add_access_role_scope_value :writer, :special, group
|
166
286
|
end
|
167
287
|
|
168
288
|
##
|
169
289
|
# Add owner access to a user.
|
290
|
+
#
|
291
|
+
# @param [String] email The email address for the entity.
|
292
|
+
#
|
293
|
+
# @example
|
294
|
+
# require "google/cloud/bigquery"
|
295
|
+
#
|
296
|
+
# bigquery = Google::Cloud::Bigquery.new
|
297
|
+
# dataset = bigquery.dataset "my_dataset"
|
298
|
+
#
|
299
|
+
# dataset.access do |access|
|
300
|
+
# access.add_owner_user "entity@example.com"
|
301
|
+
# end
|
302
|
+
#
|
170
303
|
def add_owner_user email
|
171
304
|
add_access_role_scope_value :owner, :user, email
|
172
305
|
end
|
173
306
|
|
174
307
|
##
|
175
308
|
# Add owner access to a group.
|
309
|
+
#
|
310
|
+
# @param [String] email The email address for the entity.
|
311
|
+
#
|
312
|
+
# @example
|
313
|
+
# require "google/cloud/bigquery"
|
314
|
+
#
|
315
|
+
# bigquery = Google::Cloud::Bigquery.new
|
316
|
+
# dataset = bigquery.dataset "my_dataset"
|
317
|
+
#
|
318
|
+
# dataset.access do |access|
|
319
|
+
# access.add_owner_group "entity@example.com"
|
320
|
+
# end
|
321
|
+
#
|
176
322
|
def add_owner_group email
|
177
323
|
add_access_role_scope_value :owner, :group, email
|
178
324
|
end
|
179
325
|
|
180
326
|
##
|
181
327
|
# Add owner access to a domain.
|
328
|
+
#
|
329
|
+
# @param [String] domain A [Cloud Identity
|
330
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
331
|
+
#
|
332
|
+
# @example
|
333
|
+
# require "google/cloud/bigquery"
|
334
|
+
#
|
335
|
+
# bigquery = Google::Cloud::Bigquery.new
|
336
|
+
# dataset = bigquery.dataset "my_dataset"
|
337
|
+
#
|
338
|
+
# dataset.access do |access|
|
339
|
+
# access.add_owner_domain "example.com"
|
340
|
+
# end
|
341
|
+
#
|
182
342
|
def add_owner_domain domain
|
183
343
|
add_access_role_scope_value :owner, :domain, domain
|
184
344
|
end
|
185
345
|
|
186
346
|
##
|
187
347
|
# Add owner access to a special group.
|
188
|
-
#
|
348
|
+
#
|
349
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
350
|
+
# `readers`, and `all`.
|
351
|
+
#
|
352
|
+
# @example
|
353
|
+
# require "google/cloud/bigquery"
|
354
|
+
#
|
355
|
+
# bigquery = Google::Cloud::Bigquery.new
|
356
|
+
# dataset = bigquery.dataset "my_dataset"
|
357
|
+
#
|
358
|
+
# dataset.access do |access|
|
359
|
+
# access.add_owner_special :all
|
360
|
+
# end
|
361
|
+
#
|
189
362
|
def add_owner_special group
|
190
363
|
add_access_role_scope_value :owner, :special, group
|
191
364
|
end
|
192
365
|
|
193
366
|
##
|
194
367
|
# Remove reader access from a user.
|
368
|
+
#
|
369
|
+
# @param [String] email The email address for the entity.
|
370
|
+
#
|
371
|
+
# @example
|
372
|
+
# require "google/cloud/bigquery"
|
373
|
+
#
|
374
|
+
# bigquery = Google::Cloud::Bigquery.new
|
375
|
+
# dataset = bigquery.dataset "my_dataset"
|
376
|
+
#
|
377
|
+
# dataset.access do |access|
|
378
|
+
# access.remove_reader_user "entity@example.com"
|
379
|
+
# end
|
380
|
+
#
|
195
381
|
def remove_reader_user email
|
196
382
|
remove_access_role_scope_value :reader, :user, email
|
197
383
|
end
|
198
384
|
|
199
385
|
##
|
200
386
|
# Remove reader access from a group.
|
387
|
+
#
|
388
|
+
# @param [String] email The email address for the entity.
|
389
|
+
#
|
390
|
+
# @example
|
391
|
+
# require "google/cloud/bigquery"
|
392
|
+
#
|
393
|
+
# bigquery = Google::Cloud::Bigquery.new
|
394
|
+
# dataset = bigquery.dataset "my_dataset"
|
395
|
+
#
|
396
|
+
# dataset.access do |access|
|
397
|
+
# access.remove_reader_group "entity@example.com"
|
398
|
+
# end
|
399
|
+
#
|
201
400
|
def remove_reader_group email
|
202
401
|
remove_access_role_scope_value :reader, :group, email
|
203
402
|
end
|
204
403
|
|
205
404
|
##
|
206
405
|
# Remove reader access from a domain.
|
406
|
+
#
|
407
|
+
# @param [String] domain A [Cloud Identity
|
408
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
409
|
+
#
|
410
|
+
# @example
|
411
|
+
# require "google/cloud/bigquery"
|
412
|
+
#
|
413
|
+
# bigquery = Google::Cloud::Bigquery.new
|
414
|
+
# dataset = bigquery.dataset "my_dataset"
|
415
|
+
#
|
416
|
+
# dataset.access do |access|
|
417
|
+
# access.remove_reader_domain "example.com"
|
418
|
+
# end
|
419
|
+
#
|
207
420
|
def remove_reader_domain domain
|
208
421
|
remove_access_role_scope_value :reader, :domain, domain
|
209
422
|
end
|
210
423
|
|
211
424
|
##
|
212
425
|
# Remove reader access from a special group.
|
213
|
-
#
|
426
|
+
#
|
427
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
428
|
+
# `readers`, and `all`.
|
429
|
+
#
|
430
|
+
# @example
|
431
|
+
# require "google/cloud/bigquery"
|
432
|
+
#
|
433
|
+
# bigquery = Google::Cloud::Bigquery.new
|
434
|
+
# dataset = bigquery.dataset "my_dataset"
|
435
|
+
#
|
436
|
+
# dataset.access do |access|
|
437
|
+
# access.remove_reader_special :all
|
438
|
+
# end
|
439
|
+
#
|
214
440
|
def remove_reader_special group
|
215
441
|
remove_access_role_scope_value :reader, :special, group
|
216
442
|
end
|
217
443
|
|
218
444
|
##
|
219
445
|
# Remove reader access from a view.
|
220
|
-
#
|
221
|
-
#
|
222
|
-
# [Query
|
223
|
-
#
|
224
|
-
#
|
446
|
+
#
|
447
|
+
# @param [Google::Cloud::Bigquery::View, String] view A view object or
|
448
|
+
# a string identifier as specified by the [Query
|
449
|
+
# Reference](https://cloud.google.com/bigquery/query-reference#from):
|
450
|
+
# `project_name:datasetId.tableId`.
|
451
|
+
#
|
452
|
+
# @example
|
453
|
+
# require "google/cloud/bigquery"
|
454
|
+
#
|
455
|
+
# bigquery = Google::Cloud::Bigquery.new
|
456
|
+
# dataset = bigquery.dataset "my_dataset"
|
457
|
+
# other_dataset = bigquery.dataset "my_other_dataset"
|
458
|
+
#
|
459
|
+
# view = other_dataset.table "my_view"
|
460
|
+
#
|
461
|
+
# dataset.access do |access|
|
462
|
+
# access.remove_reader_view view
|
463
|
+
# end
|
464
|
+
#
|
225
465
|
def remove_reader_view view
|
226
466
|
remove_access_view view
|
227
467
|
end
|
228
468
|
|
229
469
|
##
|
230
470
|
# Remove writer access from a user.
|
471
|
+
#
|
472
|
+
# @param [String] email The email address for the entity.
|
473
|
+
#
|
474
|
+
# @example
|
475
|
+
# require "google/cloud/bigquery"
|
476
|
+
#
|
477
|
+
# bigquery = Google::Cloud::Bigquery.new
|
478
|
+
# dataset = bigquery.dataset "my_dataset"
|
479
|
+
#
|
480
|
+
# dataset.access do |access|
|
481
|
+
# access.remove_writer_user "entity@example.com"
|
482
|
+
# end
|
483
|
+
#
|
231
484
|
def remove_writer_user email
|
232
485
|
remove_access_role_scope_value :writer, :user, email
|
233
486
|
end
|
234
487
|
|
235
488
|
##
|
236
489
|
# Remove writer access from a group.
|
490
|
+
#
|
491
|
+
# @param [String] email The email address for the entity.
|
492
|
+
#
|
493
|
+
# @example
|
494
|
+
# require "google/cloud/bigquery"
|
495
|
+
#
|
496
|
+
# bigquery = Google::Cloud::Bigquery.new
|
497
|
+
# dataset = bigquery.dataset "my_dataset"
|
498
|
+
#
|
499
|
+
# dataset.access do |access|
|
500
|
+
# access.remove_writer_group "entity@example.com"
|
501
|
+
# end
|
502
|
+
#
|
237
503
|
def remove_writer_group email
|
238
504
|
remove_access_role_scope_value :writer, :group, email
|
239
505
|
end
|
240
506
|
|
241
507
|
##
|
242
508
|
# Remove writer access from a domain.
|
509
|
+
#
|
510
|
+
# @param [String] domain A [Cloud Identity
|
511
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
512
|
+
#
|
513
|
+
# @example
|
514
|
+
# require "google/cloud/bigquery"
|
515
|
+
#
|
516
|
+
# bigquery = Google::Cloud::Bigquery.new
|
517
|
+
# dataset = bigquery.dataset "my_dataset"
|
518
|
+
#
|
519
|
+
# dataset.access do |access|
|
520
|
+
# access.remove_writer_domain "example.com"
|
521
|
+
# end
|
522
|
+
#
|
243
523
|
def remove_writer_domain domain
|
244
524
|
remove_access_role_scope_value :writer, :domain, domain
|
245
525
|
end
|
246
526
|
|
247
527
|
##
|
248
528
|
# Remove writer access from a special group.
|
249
|
-
#
|
529
|
+
#
|
530
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
531
|
+
# `readers`, and `all`.
|
532
|
+
#
|
533
|
+
# @example
|
534
|
+
# require "google/cloud/bigquery"
|
535
|
+
#
|
536
|
+
# bigquery = Google::Cloud::Bigquery.new
|
537
|
+
# dataset = bigquery.dataset "my_dataset"
|
538
|
+
#
|
539
|
+
# dataset.access do |access|
|
540
|
+
# access.remove_writer_special :all
|
541
|
+
# end
|
542
|
+
#
|
250
543
|
def remove_writer_special group
|
251
544
|
remove_access_role_scope_value :writer, :special, group
|
252
545
|
end
|
253
546
|
|
254
547
|
##
|
255
548
|
# Remove owner access from a user.
|
549
|
+
#
|
550
|
+
# @param [String] email The email address for the entity.
|
551
|
+
#
|
552
|
+
# @example
|
553
|
+
# require "google/cloud/bigquery"
|
554
|
+
#
|
555
|
+
# bigquery = Google::Cloud::Bigquery.new
|
556
|
+
# dataset = bigquery.dataset "my_dataset"
|
557
|
+
#
|
558
|
+
# dataset.access do |access|
|
559
|
+
# access.remove_owner_user "entity@example.com"
|
560
|
+
# end
|
561
|
+
#
|
256
562
|
def remove_owner_user email
|
257
563
|
remove_access_role_scope_value :owner, :user, email
|
258
564
|
end
|
259
565
|
|
260
566
|
##
|
261
567
|
# Remove owner access from a group.
|
568
|
+
#
|
569
|
+
# @param [String] email The email address for the entity.
|
570
|
+
#
|
571
|
+
# @example
|
572
|
+
# require "google/cloud/bigquery"
|
573
|
+
#
|
574
|
+
# bigquery = Google::Cloud::Bigquery.new
|
575
|
+
# dataset = bigquery.dataset "my_dataset"
|
576
|
+
#
|
577
|
+
# dataset.access do |access|
|
578
|
+
# access.remove_owner_group "entity@example.com"
|
579
|
+
# end
|
580
|
+
#
|
262
581
|
def remove_owner_group email
|
263
582
|
remove_access_role_scope_value :owner, :group, email
|
264
583
|
end
|
265
584
|
|
266
585
|
##
|
267
586
|
# Remove owner access from a domain.
|
587
|
+
#
|
588
|
+
# @param [String] domain A [Cloud Identity
|
589
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
590
|
+
#
|
591
|
+
# @example
|
592
|
+
# require "google/cloud/bigquery"
|
593
|
+
#
|
594
|
+
# bigquery = Google::Cloud::Bigquery.new
|
595
|
+
# dataset = bigquery.dataset "my_dataset"
|
596
|
+
#
|
597
|
+
# dataset.access do |access|
|
598
|
+
# access.remove_owner_domain "example.com"
|
599
|
+
# end
|
600
|
+
#
|
268
601
|
def remove_owner_domain domain
|
269
602
|
remove_access_role_scope_value :owner, :domain, domain
|
270
603
|
end
|
271
604
|
|
272
605
|
##
|
273
606
|
# Remove owner access from a special group.
|
274
|
-
#
|
607
|
+
#
|
608
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
609
|
+
# `readers`, and `all`.
|
610
|
+
#
|
611
|
+
# @example
|
612
|
+
# require "google/cloud/bigquery"
|
613
|
+
#
|
614
|
+
# bigquery = Google::Cloud::Bigquery.new
|
615
|
+
# dataset = bigquery.dataset "my_dataset"
|
616
|
+
#
|
617
|
+
# dataset.access do |access|
|
618
|
+
# access.remove_owner_special :all
|
619
|
+
# end
|
620
|
+
#
|
275
621
|
def remove_owner_special group
|
276
622
|
remove_access_role_scope_value :owner, :special, group
|
277
623
|
end
|
278
624
|
|
279
625
|
##
|
280
626
|
# Checks reader access for a user.
|
627
|
+
#
|
628
|
+
# @param [String] email The email address for the entity.
|
629
|
+
#
|
630
|
+
# @example
|
631
|
+
# require "google/cloud/bigquery"
|
632
|
+
#
|
633
|
+
# bigquery = Google::Cloud::Bigquery.new
|
634
|
+
# dataset = bigquery.dataset "my_dataset"
|
635
|
+
#
|
636
|
+
# access = dataset.access
|
637
|
+
# access.reader_user? "entity@example.com" #=> false
|
638
|
+
#
|
281
639
|
def reader_user? email
|
282
640
|
lookup_access_role_scope_value :reader, :user, email
|
283
641
|
end
|
284
642
|
|
285
643
|
##
|
286
644
|
# Checks reader access for a group.
|
645
|
+
#
|
646
|
+
# @param [String] email The email address for the entity.
|
647
|
+
#
|
648
|
+
# @example
|
649
|
+
# require "google/cloud/bigquery"
|
650
|
+
#
|
651
|
+
# bigquery = Google::Cloud::Bigquery.new
|
652
|
+
# dataset = bigquery.dataset "my_dataset"
|
653
|
+
#
|
654
|
+
# access = dataset.access
|
655
|
+
# access.reader_group? "entity@example.com" #=> false
|
656
|
+
#
|
287
657
|
def reader_group? email
|
288
658
|
lookup_access_role_scope_value :reader, :group, email
|
289
659
|
end
|
290
660
|
|
291
661
|
##
|
292
662
|
# Checks reader access for a domain.
|
663
|
+
#
|
664
|
+
# @param [String] domain A [Cloud Identity
|
665
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
666
|
+
#
|
667
|
+
# @example
|
668
|
+
# require "google/cloud/bigquery"
|
669
|
+
#
|
670
|
+
# bigquery = Google::Cloud::Bigquery.new
|
671
|
+
# dataset = bigquery.dataset "my_dataset"
|
672
|
+
#
|
673
|
+
# access = dataset.access
|
674
|
+
# access.reader_domain? "example.com" #=> false
|
675
|
+
#
|
293
676
|
def reader_domain? domain
|
294
677
|
lookup_access_role_scope_value :reader, :domain, domain
|
295
678
|
end
|
296
679
|
|
297
680
|
##
|
298
681
|
# Checks reader access for a special group.
|
299
|
-
#
|
682
|
+
#
|
683
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
684
|
+
# `readers`, and `all`.
|
685
|
+
#
|
686
|
+
# @example
|
687
|
+
# require "google/cloud/bigquery"
|
688
|
+
#
|
689
|
+
# bigquery = Google::Cloud::Bigquery.new
|
690
|
+
# dataset = bigquery.dataset "my_dataset"
|
691
|
+
#
|
692
|
+
# access = dataset.access
|
693
|
+
# access.reader_special? :all #=> false
|
694
|
+
#
|
300
695
|
def reader_special? group
|
301
696
|
lookup_access_role_scope_value :reader, :special, group
|
302
697
|
end
|
303
698
|
|
304
699
|
##
|
305
700
|
# Checks reader access for a view.
|
306
|
-
#
|
307
|
-
#
|
308
|
-
# [Query
|
309
|
-
#
|
310
|
-
#
|
701
|
+
#
|
702
|
+
# @param [Google::Cloud::Bigquery::View, String] view A view object or
|
703
|
+
# a string identifier as specified by the [Query
|
704
|
+
# Reference](https://cloud.google.com/bigquery/query-reference#from):
|
705
|
+
# `project_name:datasetId.tableId`.
|
706
|
+
#
|
707
|
+
# @example
|
708
|
+
# require "google/cloud/bigquery"
|
709
|
+
#
|
710
|
+
# bigquery = Google::Cloud::Bigquery.new
|
711
|
+
# dataset = bigquery.dataset "my_dataset"
|
712
|
+
# other_dataset = bigquery.dataset "my_other_dataset"
|
713
|
+
#
|
714
|
+
# view = other_dataset.table "my_view"
|
715
|
+
#
|
716
|
+
# access = dataset.access
|
717
|
+
# access.reader_view? view #=> false
|
718
|
+
#
|
311
719
|
def reader_view? view
|
312
720
|
lookup_access_view view
|
313
721
|
end
|
314
722
|
|
315
723
|
##
|
316
724
|
# Checks writer access for a user.
|
725
|
+
#
|
726
|
+
# @param [String] email The email address for the entity.
|
727
|
+
#
|
728
|
+
# @example
|
729
|
+
# require "google/cloud/bigquery"
|
730
|
+
#
|
731
|
+
# bigquery = Google::Cloud::Bigquery.new
|
732
|
+
# dataset = bigquery.dataset "my_dataset"
|
733
|
+
#
|
734
|
+
# access = dataset.access
|
735
|
+
# access.writer_user? "entity@example.com" #=> false
|
736
|
+
#
|
317
737
|
def writer_user? email
|
318
738
|
lookup_access_role_scope_value :writer, :user, email
|
319
739
|
end
|
320
740
|
|
321
741
|
##
|
322
742
|
# Checks writer access for a group.
|
743
|
+
#
|
744
|
+
# @param [String] email The email address for the entity.
|
745
|
+
#
|
746
|
+
# @example
|
747
|
+
# require "google/cloud/bigquery"
|
748
|
+
#
|
749
|
+
# bigquery = Google::Cloud::Bigquery.new
|
750
|
+
# dataset = bigquery.dataset "my_dataset"
|
751
|
+
#
|
752
|
+
# access = dataset.access
|
753
|
+
# access.writer_group? "entity@example.com" #=> false
|
754
|
+
#
|
323
755
|
def writer_group? email
|
324
756
|
lookup_access_role_scope_value :writer, :group, email
|
325
757
|
end
|
326
758
|
|
327
759
|
##
|
328
760
|
# Checks writer access for a domain.
|
761
|
+
#
|
762
|
+
# @param [String] domain A [Cloud Identity
|
763
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
764
|
+
#
|
765
|
+
# @example
|
766
|
+
# require "google/cloud/bigquery"
|
767
|
+
#
|
768
|
+
# bigquery = Google::Cloud::Bigquery.new
|
769
|
+
# dataset = bigquery.dataset "my_dataset"
|
770
|
+
#
|
771
|
+
# access = dataset.access
|
772
|
+
# access.writer_domain? "example.com" #=> false
|
773
|
+
#
|
329
774
|
def writer_domain? domain
|
330
775
|
lookup_access_role_scope_value :writer, :domain, domain
|
331
776
|
end
|
332
777
|
|
333
778
|
##
|
334
779
|
# Checks writer access for a special group.
|
335
|
-
#
|
780
|
+
#
|
781
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
782
|
+
# `readers`, and `all`.
|
783
|
+
#
|
784
|
+
# @example
|
785
|
+
# require "google/cloud/bigquery"
|
786
|
+
#
|
787
|
+
# bigquery = Google::Cloud::Bigquery.new
|
788
|
+
# dataset = bigquery.dataset "my_dataset"
|
789
|
+
#
|
790
|
+
# access = dataset.access
|
791
|
+
# access.writer_special? :all #=> false
|
792
|
+
#
|
336
793
|
def writer_special? group
|
337
794
|
lookup_access_role_scope_value :writer, :special, group
|
338
795
|
end
|
339
796
|
|
340
797
|
##
|
341
798
|
# Checks owner access for a user.
|
799
|
+
#
|
800
|
+
# @param [String] email The email address for the entity.
|
801
|
+
#
|
802
|
+
# @example
|
803
|
+
# require "google/cloud/bigquery"
|
804
|
+
#
|
805
|
+
# bigquery = Google::Cloud::Bigquery.new
|
806
|
+
# dataset = bigquery.dataset "my_dataset"
|
807
|
+
#
|
808
|
+
# access = dataset.access
|
809
|
+
# access.owner_user? "entity@example.com" #=> false
|
810
|
+
#
|
342
811
|
def owner_user? email
|
343
812
|
lookup_access_role_scope_value :owner, :user, email
|
344
813
|
end
|
345
814
|
|
346
815
|
##
|
347
816
|
# Checks owner access for a group.
|
817
|
+
#
|
818
|
+
# @param [String] email The email address for the entity.
|
819
|
+
#
|
820
|
+
# @example
|
821
|
+
# require "google/cloud/bigquery"
|
822
|
+
#
|
823
|
+
# bigquery = Google::Cloud::Bigquery.new
|
824
|
+
# dataset = bigquery.dataset "my_dataset"
|
825
|
+
#
|
826
|
+
# access = dataset.access
|
827
|
+
# access.owner_group? "entity@example.com" #=> false
|
828
|
+
#
|
348
829
|
def owner_group? email
|
349
830
|
lookup_access_role_scope_value :owner, :group, email
|
350
831
|
end
|
351
832
|
|
352
833
|
##
|
353
834
|
# Checks owner access for a domain.
|
835
|
+
#
|
836
|
+
# @param [String] domain A [Cloud Identity
|
837
|
+
# domain](https://cloud.google.com/iam/docs/overview#cloudid_name_domain).
|
838
|
+
#
|
839
|
+
# @example
|
840
|
+
# require "google/cloud/bigquery"
|
841
|
+
#
|
842
|
+
# bigquery = Google::Cloud::Bigquery.new
|
843
|
+
# dataset = bigquery.dataset "my_dataset"
|
844
|
+
#
|
845
|
+
# access = dataset.access
|
846
|
+
# access.owner_domain? "example.com" #=> false
|
847
|
+
#
|
354
848
|
def owner_domain? domain
|
355
849
|
lookup_access_role_scope_value :owner, :domain, domain
|
356
850
|
end
|
357
851
|
|
358
852
|
##
|
359
853
|
# Checks owner access for a special group.
|
360
|
-
#
|
854
|
+
#
|
855
|
+
# @param [String] group Accepted values are `owners`, `writers`,
|
856
|
+
# `readers`, and `all`.
|
857
|
+
#
|
858
|
+
# @example
|
859
|
+
# require "google/cloud/bigquery"
|
860
|
+
#
|
861
|
+
# bigquery = Google::Cloud::Bigquery.new
|
862
|
+
# dataset = bigquery.dataset "my_dataset"
|
863
|
+
#
|
864
|
+
# access = dataset.access
|
865
|
+
# access.owner_special? :all #=> false
|
866
|
+
#
|
361
867
|
def owner_special? group
|
362
868
|
lookup_access_role_scope_value :owner, :special, group
|
363
869
|
end
|