@@ -338,6 +338,10 @@ func (d *Dataset) MetadataWithOptions(ctx context.Context, opts ...DatasetOption
338338 if cOpt .accessPolicyVersion != nil {
339339 call .AccessPolicyVersion (int64 (optional .ToInt (cOpt .accessPolicyVersion )))
340340 }
341+ if cOpt .datasetView != nil {
342+ call .DatasetView (optional .ToString (cOpt .datasetView ))
343+ }
344+
341345 var ds * bq.Dataset
342346 if err := runWithRetry (ctx , func () (err error ) {
343347 sCtx := trace .StartSpan (ctx , "bigquery.datasets.get" )
@@ -353,6 +357,8 @@ func (d *Dataset) MetadataWithOptions(ctx context.Context, opts ...DatasetOption
353357// dsCallOption provides a general option holder for dataset RPCs
354358type dsCallOption struct {
355359 accessPolicyVersion optional.Int
360+ datasetView optional.String
361+ updateMode optional.String
356362}
357363
358364// DatasetOption provides an option type for customizing requests against the Dataset
@@ -380,6 +386,62 @@ func WithAccessPolicyVersion(apv int) DatasetOption {
380386 }
381387}
382388
389+ // DatasetView specifies which details about a dataset are desired.
390+ type DatasetView string
391+
392+ const (
393+ // DatasetMetadataView populates metadata information for the dataset,
394+ // such as friendlyName, description, labels, etc.
395+ DatasetMetadataView DatasetView = "METADATA"
396+
397+ // DatasetACLView populates information for the dataset, which defines
398+ // dataset access for one or more entities.
399+ DatasetACLView DatasetView = "ACL"
400+
401+ // DatasetFullView populates both dataset metadata and ACL information.
402+ DatasetFullView DatasetView = "FULL"
403+
404+ // UnspecifiedDatasetView is the default value, which will be treated as DatasetFullView
405+ UnspecifiedDatasetView DatasetView = "DATASET_VIEW_UNSPECIFIED"
406+ )
407+
408+ // WithDatasetView specifies the view that determines which dataset information
409+ // is returned. By default, metadata and ACL information are returned.
410+ func WithDatasetView (view DatasetView ) DatasetOption {
411+ return func (o * dsCallOption ) {
412+ o .datasetView = string (view )
413+ }
414+ }
415+
416+ // DatasetUpdateMode specifies which fields of a dataset are going to be affected
417+ // by update/patch operations.
418+ type DatasetUpdateMode string
419+
420+ const (
421+ // DatasetMetadataUpdateMode targets metadata information for the dataset,
422+ // such as friendlyName, description, labels, etc.
423+ DatasetMetadataUpdateMode DatasetUpdateMode = "UPDATE_METADATA"
424+
425+ // DatasetACLUpdateMode targets ACL information for the dataset,
426+ // which defines dataset access for one or more entities.
427+ DatasetACLUpdateMode DatasetUpdateMode = "UPDATE_ACL"
428+
429+ // DatasetFullUpdateMode targets both dataset metadata and ACL
430+ // information on update operations.
431+ DatasetFullUpdateMode DatasetUpdateMode = "UPDATE_FULL"
432+
433+ // UnspecifiedDatasetUpdateMode is the default value, which will be treated as DatasetFullUpdateMode
434+ UnspecifiedDatasetUpdateMode DatasetUpdateMode = "UPDATE_MODE_UNSPECIFIED"
435+ )
436+
437+ // WithUpdateMode specifies the fields of dataset that the update/patch
438+ // operation is targeting. By default, both metadata and ACL fields are updated.
439+ func WithUpdateMode (mode DatasetUpdateMode ) DatasetOption {
440+ return func (o * dsCallOption ) {
441+ o .updateMode = string (mode )
442+ }
443+ }
444+
383445func bqToDatasetMetadata (d * bq.Dataset , c * Client ) (* DatasetMetadata , error ) {
384446 dm := & DatasetMetadata {
385447 CreationTime : unixMillisToTime (d .CreationTime ),
@@ -450,6 +512,10 @@ func (d *Dataset) UpdateWithOptions(ctx context.Context, dm DatasetMetadataToUpd
450512 if cOpt .accessPolicyVersion != nil {
451513 call .AccessPolicyVersion (int64 (optional .ToInt (cOpt .accessPolicyVersion )))
452514 }
515+ if cOpt .updateMode != nil {
516+ call .UpdateMode (optional .ToString (cOpt .updateMode ))
517+ }
518+
453519 var ds2 * bq.Dataset
454520 if err := runWithRetry (ctx , func () (err error ) {
455521 sCtx := trace .StartSpan (ctx , "bigquery.datasets.patch" )
0 commit comments