Skip to content

Commit

Permalink
feat: support selective sharing on data clean room Listings
Browse files Browse the repository at this point in the history
feat: support output fields on DcrExchangeConfig specifying selective sharing behavior on a data clean room

PiperOrigin-RevId: 616259882
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 15, 2024
1 parent 1dd41ac commit 5b66360
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
17 changes: 14 additions & 3 deletions google/cloud/bigquery/analyticshub/v1/BUILD.bazel
Expand Up @@ -9,14 +9,17 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# buildifier: disable=load-on-top

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
# buildifier: disable=same-origin-load
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "analyticshub_proto",
Expand Down Expand Up @@ -49,6 +52,7 @@ proto_library_with_info(
##############################################################################
# Java
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
Expand Down Expand Up @@ -77,8 +81,8 @@ java_gapic_library(
rest_numeric_enums = False,
service_yaml = "analyticshub_v1.yaml",
test_deps = [
"//google/iam/v1:iam_java_grpc",
":analyticshub_java_grpc",
"//google/iam/v1:iam_java_grpc",
],
transport = "grpc+rest",
deps = [
Expand Down Expand Up @@ -113,6 +117,7 @@ java_gapic_assembly_gradle_pkg(
##############################################################################
# Go
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
Expand Down Expand Up @@ -166,6 +171,7 @@ go_gapic_assembly_pkg(
##############################################################################
# Python
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
Expand Down Expand Up @@ -210,6 +216,7 @@ py_gapic_assembly_pkg(
##############################################################################
# PHP
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
Expand Down Expand Up @@ -247,6 +254,7 @@ php_gapic_assembly_pkg(
##############################################################################
# Node.js
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
Expand Down Expand Up @@ -277,6 +285,7 @@ nodejs_gapic_assembly_pkg(
##############################################################################
# Ruby
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
Expand Down Expand Up @@ -330,6 +339,7 @@ ruby_gapic_assembly_pkg(
##############################################################################
# C#
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
Expand All @@ -340,7 +350,6 @@ load(

csharp_proto_library(
name = "analyticshub_csharp_proto",
extra_opts = [],
deps = [":analyticshub_proto"],
)

Expand All @@ -357,6 +366,7 @@ csharp_gapic_library(
grpc_service_config = "analyticshub_v1_grpc_service_config.json",
rest_numeric_enums = False,
service_yaml = "analyticshub_v1.yaml",
transport = "grpc+rest",
deps = [
":analyticshub_csharp_grpc",
":analyticshub_csharp_proto",
Expand All @@ -376,6 +386,7 @@ csharp_gapic_assembly_pkg(
##############################################################################
# C++
##############################################################################
# buildifier: disable=same-origin-load
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
Expand Down
53 changes: 52 additions & 1 deletion google/cloud/bigquery/analyticshub/v1/analyticshub.proto
Expand Up @@ -39,6 +39,10 @@ option (google.api.resource_definition) = {
type: "bigquery.googleapis.com/Dataset"
pattern: "projects/{project}/datasets/{dataset}"
};
option (google.api.resource_definition) = {
type: "bigquery.googleapis.com/Table"
pattern: "projects/{project}/datasets/{dataset}/tables/{table}"
};

// The `AnalyticsHubService` API facilitates data sharing within and across
// organizations. It allows data providers to publish listings that reference
Expand Down Expand Up @@ -256,6 +260,10 @@ service AnalyticsHubService {
post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:getIamPolicy"
body: "*"
}
additional_bindings {
post: "/v1/{resource=projects/*/locations/*/subscriptions/*}:getIamPolicy"
body: "*"
}
};
}

Expand All @@ -269,6 +277,10 @@ service AnalyticsHubService {
post: "/v1/{resource=projects/*/locations/*/dataExchanges/*/listings/*}:setIamPolicy"
body: "*"
}
additional_bindings {
post: "/v1/{resource=projects/*/locations/*/subscriptions/*}:setIamPolicy"
body: "*"
}
};
}

Expand Down Expand Up @@ -341,7 +353,24 @@ message SharingEnvironmentConfig {
message DefaultExchangeConfig {}

// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
message DcrExchangeConfig {}
message DcrExchangeConfig {
// Output only. If True, this DCR restricts the contributors to sharing
// only a single resource in a Listing. And no two resources should have the
// same IDs. So if a contributor adds a view with a conflicting name, the
// CreateListing API will reject the request. if False, the data contributor
// can publish an entire dataset (as before). This is not configurable, and
// by default, all new DCRs will have the restriction set to True.
optional bool single_selected_resource_sharing_restriction = 1
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. If True, when subscribing to this DCR, it will create only
// one linked dataset containing all resources shared within the
// cleanroom. If False, when subscribing to this DCR, it will
// create 1 linked dataset per listing. This is not configurable, and by
// default, all new DCRs will have the restriction set to True.
optional bool single_linked_dataset_per_cleanroom = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
}

oneof environment {
// Default Analytics Hub data exchange, used for secured data sharing.
Expand Down Expand Up @@ -428,11 +457,33 @@ message Listing {
// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
// dataset that serves as a _symbolic link_ to a shared dataset.
message BigQueryDatasetSource {
// Resource in this dataset that are selectively shared.
message SelectedResource {
oneof resource {
// Optional. Format:
// For table:
// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
string table = 1 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "bigquery.googleapis.com/Table"
}
];
}
}

// Resource name of the dataset source for this listing.
// e.g. `projects/myproject/datasets/123`
string dataset = 1 [(google.api.resource_reference) = {
type: "bigquery.googleapis.com/Dataset"
}];

// Optional. Resources in this dataset that are selectively shared.
// If this field is empty, then the entire dataset (all resources) are
// shared. This field is only valid for data clean room exchanges.
repeated SelectedResource selected_resources = 2
[(google.api.field_behavior) = OPTIONAL];
}

// Restricted export config, used to configure restricted export on linked
Expand Down

0 comments on commit 5b66360

Please sign in to comment.