google-cloud-bigquery 1.15.0 → 1.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4df9efe3b6ac3249b82a3745877dd0aab98407b753ca178f37c9e321f3d30751
4
- data.tar.gz: 51e19ccf8ade5f37117eec63548fbefc72fb84c2537a62d6ffd539c2f4ad4360
3
+ metadata.gz: 95ecbf392c1c918219849034d540067effe661d635f7d435c1f73c0bbdcbefb3
4
+ data.tar.gz: 6452936f3e68a2fb9249fbdd23e54374ce67a86945b936adc6d06571b0266d5d
5
5
  SHA512:
6
- metadata.gz: 19d1d3d6e81228fb7c52939a72079c4016dbdf41826a79b2b010d0115bd1002b9931865d178a777a8139092fc5a147ab2046262bac2031ec2ea1de181344bca2
7
- data.tar.gz: 2061b50a1e721dd602b0a689294c326ab2e12fe379c1081b3b2de6305a8b83122d3c8065c4b3c6df725b0a0c65395d1f92a12df659ee24a4205047a0278ac08c
6
+ metadata.gz: 3c28948fc38d7fccd1b3775f209926eacbe671ddd36432660f336457d0630d8ce921b1600170cb7d56b093c2f805dd39d84230ddc04668f9e3a3d1238d0038dc
7
+ data.tar.gz: 7adba9ab644ef05f683a5a1b5f647e9106b77d997796c0d867d569caeac10d778d2948823f383f3eb7cfe1b5946b5c22a46d1403352f8358c7df1500ffdf291c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Release History
2
2
 
3
+ ### 1.16.0 / 2019-10-03
4
+
5
+ #### Features
6
+
7
+ * Add Dataset default_encryption
8
+ * Add Dataset#default_encryption
9
+ * Add Dataset#default_encryption=
10
+
3
11
  ### 1.15.0 / 2019-09-30
4
12
 
5
13
  #### Features
@@ -335,6 +335,77 @@ module Google
335
335
  patch_gapi! :labels
336
336
  end
337
337
 
338
+ ##
339
+ # The {EncryptionConfiguration} object that represents the default
340
+ # encryption method for all tables and models in the dataset. Once this
341
+ # property is set, all newly-created partitioned tables and models in
342
+ # the dataset will have their encryption set to this value, unless table
343
+ # creation request (or query) overrides it.
344
+ #
345
+ # Present only if this dataset is using custom default encryption.
346
+ #
347
+ # @see https://cloud.google.com/bigquery/docs/customer-managed-encryption
348
+ # Protecting Data with Cloud KMS Keys
349
+ #
350
+ # @return [EncryptionConfiguration, nil] The default encryption
351
+ # configuration.
352
+ #
353
+ # @!group Attributes
354
+ #
355
+ # @example
356
+ # require "google/cloud/bigquery"
357
+ #
358
+ # bigquery = Google::Cloud::Bigquery.new
359
+ # dataset = bigquery.dataset "my_dataset"
360
+ #
361
+ # encrypt_config = dataset.default_encryption
362
+ #
363
+ # @!group Attributes
364
+ #
365
+ def default_encryption
366
+ return nil if reference?
367
+ ensure_full_data!
368
+ return nil if @gapi.default_encryption_configuration.nil?
369
+ EncryptionConfiguration.from_gapi(
370
+ @gapi.default_encryption_configuration
371
+ ).freeze
372
+ end
373
+
374
+ ##
375
+ # Set the {EncryptionConfiguration} object that represents the default
376
+ # encryption method for all tables and models in the dataset. Once this
377
+ # property is set, all newly-created partitioned tables and models in
378
+ # the dataset will have their encryption set to this value, unless table
379
+ # creation request (or query) overrides it.
380
+ #
381
+ # If the dataset is not a full resource representation (see
382
+ # {#resource_full?}), the full representation will be retrieved before
383
+ # the update to comply with ETag-based optimistic concurrency control.
384
+ #
385
+ # @see https://cloud.google.com/bigquery/docs/customer-managed-encryption
386
+ # Protecting Data with Cloud KMS Keys
387
+ #
388
+ # @param [EncryptionConfiguration] value The new encryption config.
389
+ #
390
+ # @example
391
+ # require "google/cloud/bigquery"
392
+ #
393
+ # bigquery = Google::Cloud::Bigquery.new
394
+ # dataset = bigquery.dataset "my_dataset"
395
+ #
396
+ # key_name = "projects/a/locations/b/keyRings/c/cryptoKeys/d"
397
+ # encrypt_config = bigquery.encryption kms_key: key_name
398
+ #
399
+ # dataset.default_encryption = encrypt_config
400
+ #
401
+ # @!group Attributes
402
+ #
403
+ def default_encryption= value
404
+ ensure_full_data!
405
+ @gapi.default_encryption_configuration = value.to_gapi
406
+ patch_gapi! :default_encryption_configuration
407
+ end
408
+
338
409
  ##
339
410
  # Retrieves the access rules for a Dataset. The rules can be updated
340
411
  # when passing a block, see {Dataset::Access} for all the methods
@@ -2181,7 +2252,7 @@ module Google
2181
2252
  # Load the complete representation of the dataset if it has been
2182
2253
  # only partially loaded by a request to the API list method.
2183
2254
  def ensure_full_data!
2184
- reload! if resource_partial?
2255
+ reload! unless resource_full?
2185
2256
  end
2186
2257
 
2187
2258
  def ensure_job_succeeded! job
@@ -368,8 +368,8 @@ module Google
368
368
 
369
369
  ##
370
370
  # The {EncryptionConfiguration} object that represents the custom
371
- # encryption method used to protect this model. If not set, default
372
- # encryption is used.
371
+ # encryption method used to protect this model. If not set,
372
+ # {Dataset#default_encryption} is used.
373
373
  #
374
374
  # Present only if this model is using custom encryption.
375
375
  #
@@ -406,8 +406,8 @@ module Google
406
406
 
407
407
  ##
408
408
  # Set the {EncryptionConfiguration} object that represents the custom
409
- # encryption method used to protect this model. If not set, default
410
- # encryption is used.
409
+ # encryption method used to protect this model. If not set,
410
+ # {Dataset#default_encryption} is used.
411
411
  #
412
412
  # Present only if this model is using custom encryption.
413
413
  #
@@ -875,8 +875,8 @@ module Google
875
875
 
876
876
  ##
877
877
  # The {EncryptionConfiguration} object that represents the custom
878
- # encryption method used to protect the table. If not set, default
879
- # encryption is used.
878
+ # encryption method used to protect the table. If not set,
879
+ # {Dataset#default_encryption} is used.
880
880
  #
881
881
  # Present only if the table is using custom encryption.
882
882
  #
@@ -897,8 +897,8 @@ module Google
897
897
 
898
898
  ##
899
899
  # Set the {EncryptionConfiguration} object that represents the custom
900
- # encryption method used to protect the table. If not set, default
901
- # encryption is used.
900
+ # encryption method used to protect the table. If not set,
901
+ # {Dataset#default_encryption} is used.
902
902
  #
903
903
  # Present only if the table is using custom encryption.
904
904
  #
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "1.15.0".freeze
19
+ VERSION = "1.16.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-30 00:00:00.000000000 Z
12
+ date: 2019-10-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core