diff --git a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection/__init__.py b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection/__init__.py index a4d7ab18016b..ccf23ddd4050 100644 --- a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection/__init__.py +++ b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection/__init__.py @@ -40,6 +40,7 @@ ListConnectionsRequest, ListConnectionsResponse, MetastoreServiceConfig, + SalesforceDataCloudProperties, SparkHistoryServerConfig, SparkProperties, UpdateConnectionRequest, @@ -63,6 +64,7 @@ "ListConnectionsRequest", "ListConnectionsResponse", "MetastoreServiceConfig", + "SalesforceDataCloudProperties", "SparkHistoryServerConfig", "SparkProperties", "UpdateConnectionRequest", diff --git a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/__init__.py b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/__init__.py index 6857887b0f90..fe9a4db86449 100644 --- a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/__init__.py +++ b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/__init__.py @@ -38,6 +38,7 @@ ListConnectionsRequest, ListConnectionsResponse, MetastoreServiceConfig, + SalesforceDataCloudProperties, SparkHistoryServerConfig, SparkProperties, UpdateConnectionRequest, @@ -61,6 +62,7 @@ "ListConnectionsRequest", "ListConnectionsResponse", "MetastoreServiceConfig", + "SalesforceDataCloudProperties", "SparkHistoryServerConfig", "SparkProperties", "UpdateConnectionRequest", diff --git a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/__init__.py b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/__init__.py index 2137becd07d9..806e60cf18f4 100644 --- a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/__init__.py +++ b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/__init__.py @@ -29,6 +29,7 @@ ListConnectionsRequest, ListConnectionsResponse, MetastoreServiceConfig, + SalesforceDataCloudProperties, SparkHistoryServerConfig, SparkProperties, UpdateConnectionRequest, @@ -50,6 +51,7 @@ "ListConnectionsRequest", "ListConnectionsResponse", "MetastoreServiceConfig", + "SalesforceDataCloudProperties", "SparkHistoryServerConfig", "SparkProperties", "UpdateConnectionRequest", diff --git a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/connection.py b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/connection.py index 62e5ebad834c..551639b6f854 100644 --- a/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/connection.py +++ b/packages/google-cloud-bigquery-connection/google/cloud/bigquery_connection_v1/types/connection.py @@ -41,6 +41,7 @@ "MetastoreServiceConfig", "SparkHistoryServerConfig", "SparkProperties", + "SalesforceDataCloudProperties", }, ) @@ -235,6 +236,14 @@ class Connection(proto.Message): spark (google.cloud.bigquery_connection_v1.types.SparkProperties): Spark properties. + This field is a member of `oneof`_ ``properties``. + salesforce_data_cloud (google.cloud.bigquery_connection_v1.types.SalesforceDataCloudProperties): + Optional. Salesforce DataCloud properties. + This field is intended for use only by + Salesforce partner projects. This field contains + properties for your Salesforce DataCloud + connection. + This field is a member of `oneof`_ ``properties``. creation_time (int): Output only. The creation timestamp of the @@ -295,6 +304,12 @@ class Connection(proto.Message): oneof="properties", message="SparkProperties", ) + salesforce_data_cloud: "SalesforceDataCloudProperties" = proto.Field( + proto.MESSAGE, + number=24, + oneof="properties", + message="SalesforceDataCloudProperties", + ) creation_time: int = proto.Field( proto.INT64, number=5, @@ -402,30 +417,38 @@ class CloudSpannerProperties(proto.Message): use_parallelism (bool): If parallelism should be used when reading from Cloud Spanner + max_parallelism (int): + Allows setting max parallelism per query when executing on + Spanner independent compute resources. If unspecified, + default values of parallelism are chosen that are dependent + on the Cloud Spanner instance configuration. + + REQUIRES: ``use_parallelism`` must be set. REQUIRES: Either + ``use_data_boost`` or ``use_serverless_analytics`` must be + set. use_serverless_analytics (bool): If the serverless analytics service should be used to read data from Cloud Spanner. Note: ``use_parallelism`` must be set when using serverless analytics. + use_data_boost (bool): + If set, the request will be executed via Spanner independent + compute resources. REQUIRES: ``use_parallelism`` must be + set. + + NOTE: ``use_serverless_analytics`` will be deprecated. + Prefer ``use_data_boost`` over ``use_serverless_analytics``. database_role (str): - Optional. Cloud Spanner database role for - fine-grained access control. A database role is - a collection of fine-grained access privileges. - Example: Admin predefines roles that provides - user a set of permissions (SELECT, INSERT, ..). - The user can then specify a predefined role on a - connection to execute their Cloud Spanner query. - The role is passthrough here. If the user is not - authorized to use the specified role, they get - an error. This validation happens on Cloud - Spanner. - - See - https://cloud.google.com/spanner/docs/fgac-about - for more details. - REQUIRES: database role name must start with - uppercase/lowercase letter and only contain - uppercase/lowercase letters, numbers, and - underscores. + Optional. Cloud Spanner database role for fine-grained + access control. The Cloud Spanner admin should have + provisioned the database role with appropriate permissions, + such as ``SELECT`` and ``INSERT``. Other users should only + use roles provided by their Cloud Spanner admins. + + For more details, see [About fine-grained access control] + (https://cloud.google.com/spanner/docs/fgac-about). + + REQUIRES: The database role name must start with a letter, + and can only contain letters, numbers, and underscores. """ database: str = proto.Field( @@ -436,10 +459,18 @@ class CloudSpannerProperties(proto.Message): proto.BOOL, number=2, ) + max_parallelism: int = proto.Field( + proto.INT32, + number=5, + ) use_serverless_analytics: bool = proto.Field( proto.BOOL, number=3, ) + use_data_boost: bool = proto.Field( + proto.BOOL, + number=6, + ) database_role: str = proto.Field( proto.STRING, number=4, @@ -683,7 +714,7 @@ class SparkProperties(proto.Message): permissions to the service account. When the connection is used in the context of a stored procedure for Apache Spark in BigQuery, the - service account will be used to connect to the + service account is used to connect to the desired resources in Google Cloud. The account ID is in the form of: bqcx--@gcp-sa-bigquery-consp.iam.gserviceaccount.com @@ -711,4 +742,34 @@ class SparkProperties(proto.Message): ) +class SalesforceDataCloudProperties(proto.Message): + r"""Connection properties specific to Salesforce DataCloud. This + is intended for use only by Salesforce partner projects. + + Attributes: + instance_uri (str): + The URL to the user's Salesforce DataCloud + instance. + identity (str): + Output only. A unique Google-owned and + Google-generated service account identity for + the connection. + tenant_id (str): + The ID of the user's Salesforce tenant. + """ + + instance_uri: str = proto.Field( + proto.STRING, + number=1, + ) + identity: str = proto.Field( + proto.STRING, + number=2, + ) + tenant_id: str = proto.Field( + proto.STRING, + number=3, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-bigquery-connection/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json b/packages/google-cloud-bigquery-connection/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json index 42cb58684e4d..0fde6f0d6368 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json +++ b/packages/google-cloud-bigquery-connection/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-bigquery-connection", - "version": "1.12.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-bigquery-connection/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py b/packages/google-cloud-bigquery-connection/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py index 1da6f8d65ec9..c5e38b91f281 100644 --- a/packages/google-cloud-bigquery-connection/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py +++ b/packages/google-cloud-bigquery-connection/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py @@ -3047,7 +3047,9 @@ def test_create_connection_rest(request_type): "cloud_spanner": { "database": "database_value", "use_parallelism": True, + "max_parallelism": 1595, "use_serverless_analytics": True, + "use_data_boost": True, "database_role": "database_role_value", }, "cloud_resource": {"service_account_id": "service_account_id_value"}, @@ -3060,6 +3062,11 @@ def test_create_connection_rest(request_type): "dataproc_cluster": "dataproc_cluster_value" }, }, + "salesforce_data_cloud": { + "instance_uri": "instance_uri_value", + "identity": "identity_value", + "tenant_id": "tenant_id_value", + }, "creation_time": 1379, "last_modified_time": 1890, "has_credential": True, @@ -3296,7 +3303,9 @@ def test_create_connection_rest_bad_request( "cloud_spanner": { "database": "database_value", "use_parallelism": True, + "max_parallelism": 1595, "use_serverless_analytics": True, + "use_data_boost": True, "database_role": "database_role_value", }, "cloud_resource": {"service_account_id": "service_account_id_value"}, @@ -3309,6 +3318,11 @@ def test_create_connection_rest_bad_request( "dataproc_cluster": "dataproc_cluster_value" }, }, + "salesforce_data_cloud": { + "instance_uri": "instance_uri_value", + "identity": "identity_value", + "tenant_id": "tenant_id_value", + }, "creation_time": 1379, "last_modified_time": 1890, "has_credential": True, @@ -4080,7 +4094,9 @@ def test_update_connection_rest(request_type): "cloud_spanner": { "database": "database_value", "use_parallelism": True, + "max_parallelism": 1595, "use_serverless_analytics": True, + "use_data_boost": True, "database_role": "database_role_value", }, "cloud_resource": {"service_account_id": "service_account_id_value"}, @@ -4093,6 +4109,11 @@ def test_update_connection_rest(request_type): "dataproc_cluster": "dataproc_cluster_value" }, }, + "salesforce_data_cloud": { + "instance_uri": "instance_uri_value", + "identity": "identity_value", + "tenant_id": "tenant_id_value", + }, "creation_time": 1379, "last_modified_time": 1890, "has_credential": True, @@ -4330,7 +4351,9 @@ def test_update_connection_rest_bad_request( "cloud_spanner": { "database": "database_value", "use_parallelism": True, + "max_parallelism": 1595, "use_serverless_analytics": True, + "use_data_boost": True, "database_role": "database_role_value", }, "cloud_resource": {"service_account_id": "service_account_id_value"}, @@ -4343,6 +4366,11 @@ def test_update_connection_rest_bad_request( "dataproc_cluster": "dataproc_cluster_value" }, }, + "salesforce_data_cloud": { + "instance_uri": "instance_uri_value", + "identity": "identity_value", + "tenant_id": "tenant_id_value", + }, "creation_time": 1379, "last_modified_time": 1890, "has_credential": True,