diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d9246dd..cf198b9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.0" + ".": "1.11.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 58be119..206ff39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.11.0](https://github.com/googleapis/python-bigquery-connection/compare/v1.10.0...v1.11.0) (2023-03-01) + + +### Features + +* Add cloud spanner connection properties - database role ([181685a](https://github.com/googleapis/python-bigquery-connection/commit/181685a1a82d4d932b4108580328f5ee09718513)) +* Add cloud spanner connection properties - serverless analytics ([181685a](https://github.com/googleapis/python-bigquery-connection/commit/181685a1a82d4d932b4108580328f5ee09718513)) + ## [1.10.0](https://github.com/googleapis/python-bigquery-connection/compare/v1.9.1...v1.10.0) (2023-02-27) diff --git a/google/cloud/bigquery_connection/gapic_version.py b/google/cloud/bigquery_connection/gapic_version.py index 7ce1917..98fb3f5 100644 --- a/google/cloud/bigquery_connection/gapic_version.py +++ b/google/cloud/bigquery_connection/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.10.0" # {x-release-please-version} +__version__ = "1.11.0" # {x-release-please-version} diff --git a/google/cloud/bigquery_connection_v1/gapic_version.py b/google/cloud/bigquery_connection_v1/gapic_version.py index 7ce1917..98fb3f5 100644 --- a/google/cloud/bigquery_connection_v1/gapic_version.py +++ b/google/cloud/bigquery_connection_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.10.0" # {x-release-please-version} +__version__ = "1.11.0" # {x-release-please-version} diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/async_client.py b/google/cloud/bigquery_connection_v1/services/connection_service/async_client.py index 55ae433..f2a7bb2 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/async_client.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/async_client.py @@ -512,7 +512,7 @@ async def sample_list_connections(): Returns: google.cloud.bigquery_connection_v1.services.connection_service.pagers.ListConnectionsAsyncPager: The response for - [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. + [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. Iterating over this object will yield results and resolve additional pages automatically. diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/client.py b/google/cloud/bigquery_connection_v1/services/connection_service/client.py index 61bb122..e2ef971 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/client.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/client.py @@ -733,7 +733,7 @@ def sample_list_connections(): Returns: google.cloud.bigquery_connection_v1.services.connection_service.pagers.ListConnectionsPager: The response for - [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. + [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. Iterating over this object will yield results and resolve additional pages automatically. diff --git a/google/cloud/bigquery_connection_v1/services/connection_service/transports/rest.py b/google/cloud/bigquery_connection_v1/services/connection_service/transports/rest.py index c9f3dba..e16cce9 100644 --- a/google/cloud/bigquery_connection_v1/services/connection_service/transports/rest.py +++ b/google/cloud/bigquery_connection_v1/services/connection_service/transports/rest.py @@ -17,7 +17,7 @@ import dataclasses import json # type: ignore import re -from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import warnings from google.api_core import gapic_v1, path_template, rest_helpers, rest_streaming @@ -404,7 +404,7 @@ class _CreateConnection(ConnectionServiceRestStub): def __hash__(self): return hash("CreateConnection") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -506,7 +506,7 @@ class _DeleteConnection(ConnectionServiceRestStub): def __hash__(self): return hash("DeleteConnection") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -584,7 +584,7 @@ class _GetConnection(ConnectionServiceRestStub): def __hash__(self): return hash("GetConnection") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -675,7 +675,7 @@ class _GetIamPolicy(ConnectionServiceRestStub): def __hash__(self): return hash("GetIamPolicy") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -844,7 +844,7 @@ class _ListConnections(ConnectionServiceRestStub): def __hash__(self): return hash("ListConnections") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = { + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = { "pageSize": 0, } @@ -938,7 +938,7 @@ class _SetIamPolicy(ConnectionServiceRestStub): def __hash__(self): return hash("SetIamPolicy") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1107,7 +1107,7 @@ class _TestIamPermissions(ConnectionServiceRestStub): def __hash__(self): return hash("TestIamPermissions") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1204,7 +1204,7 @@ class _UpdateConnection(ConnectionServiceRestStub): def __hash__(self): return hash("UpdateConnection") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = { + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = { "updateMask": {}, } diff --git a/google/cloud/bigquery_connection_v1/types/connection.py b/google/cloud/bigquery_connection_v1/types/connection.py index f913579..6d82fea 100644 --- a/google/cloud/bigquery_connection_v1/types/connection.py +++ b/google/cloud/bigquery_connection_v1/types/connection.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence from google.protobuf import field_mask_pb2 # type: ignore @@ -310,10 +312,11 @@ class CloudSqlProperties(proto.Message): service_account_id (str): Output only. The account ID of the service used for the purpose of this connection. + When the connection is used in the context of an operation in BigQuery, this service account will - serve as identity being used for connecting to - the CloudSQL instance specified in this + serve as the identity being used for connecting + to the CloudSQL instance specified in this connection. """ @@ -386,6 +389,30 @@ class CloudSpannerProperties(proto.Message): use_parallelism (bool): If parallelism should be used when reading from Cloud Spanner + 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. + 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. """ database: str = proto.Field( @@ -396,6 +423,14 @@ class CloudSpannerProperties(proto.Message): proto.BOOL, number=2, ) + use_serverless_analytics: bool = proto.Field( + proto.BOOL, + number=3, + ) + database_role: str = proto.Field( + proto.STRING, + number=4, + ) class AwsProperties(proto.Message): @@ -514,7 +549,7 @@ class AzureProperties(proto.Message): The URL user will be redirected to after granting consent during connection setup. federated_application_client_id (str): - The client id of the user's Azure Active + The client ID of the user's Azure Active Directory Application used for a federated connection. identity (str): @@ -562,6 +597,7 @@ class CloudResourceProperties(proto.Message): service_account_id (str): Output only. The account ID of the service created for the purpose of this connection. + The service account does not have any permissions associated with it when it is created. After creation, customers delegate diff --git a/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json index cfd0434..07a2015 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-bigquery-connection", - "version": "1.10.0" + "version": "1.11.0" }, "snippets": [ { diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 30248e2..6097b43 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-bigquery-connection==1.9.1 \ No newline at end of file +google-cloud-bigquery-connection==1.10.0 \ No newline at end of file diff --git a/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py b/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py index 4989c63..07fcb37 100644 --- a/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py +++ b/tests/unit/gapic/bigquery_connection_v1/test_connection_service.py @@ -3049,7 +3049,12 @@ def test_create_connection_rest(request_type): "federated_application_client_id": "federated_application_client_id_value", "identity": "identity_value", }, - "cloud_spanner": {"database": "database_value", "use_parallelism": True}, + "cloud_spanner": { + "database": "database_value", + "use_parallelism": True, + "use_serverless_analytics": True, + "database_role": "database_role_value", + }, "cloud_resource": {"service_account_id": "service_account_id_value"}, "creation_time": 1379, "last_modified_time": 1890, @@ -3287,7 +3292,12 @@ def test_create_connection_rest_bad_request( "federated_application_client_id": "federated_application_client_id_value", "identity": "identity_value", }, - "cloud_spanner": {"database": "database_value", "use_parallelism": True}, + "cloud_spanner": { + "database": "database_value", + "use_parallelism": True, + "use_serverless_analytics": True, + "database_role": "database_role_value", + }, "cloud_resource": {"service_account_id": "service_account_id_value"}, "creation_time": 1379, "last_modified_time": 1890, @@ -4058,7 +4068,12 @@ def test_update_connection_rest(request_type): "federated_application_client_id": "federated_application_client_id_value", "identity": "identity_value", }, - "cloud_spanner": {"database": "database_value", "use_parallelism": True}, + "cloud_spanner": { + "database": "database_value", + "use_parallelism": True, + "use_serverless_analytics": True, + "database_role": "database_role_value", + }, "cloud_resource": {"service_account_id": "service_account_id_value"}, "creation_time": 1379, "last_modified_time": 1890, @@ -4297,7 +4312,12 @@ def test_update_connection_rest_bad_request( "federated_application_client_id": "federated_application_client_id_value", "identity": "identity_value", }, - "cloud_spanner": {"database": "database_value", "use_parallelism": True}, + "cloud_spanner": { + "database": "database_value", + "use_parallelism": True, + "use_serverless_analytics": True, + "database_role": "database_role_value", + }, "cloud_resource": {"service_account_id": "service_account_id_value"}, "creation_time": 1379, "last_modified_time": 1890,