Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

feat: Add Cloud_Resource Connection Support #181

Merged
merged 3 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/bigquery_connection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from google.cloud.bigquery_connection_v1.types.connection import AwsAccessRole
from google.cloud.bigquery_connection_v1.types.connection import AwsCrossAccountRole
from google.cloud.bigquery_connection_v1.types.connection import AwsProperties
from google.cloud.bigquery_connection_v1.types.connection import CloudResourceProperties
from google.cloud.bigquery_connection_v1.types.connection import CloudSpannerProperties
from google.cloud.bigquery_connection_v1.types.connection import CloudSqlCredential
from google.cloud.bigquery_connection_v1.types.connection import CloudSqlProperties
Expand All @@ -41,6 +42,7 @@
"AwsAccessRole",
"AwsCrossAccountRole",
"AwsProperties",
"CloudResourceProperties",
"CloudSpannerProperties",
"CloudSqlCredential",
"CloudSqlProperties",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigquery_connection_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .types.connection import AwsAccessRole
from .types.connection import AwsCrossAccountRole
from .types.connection import AwsProperties
from .types.connection import CloudResourceProperties
from .types.connection import CloudSpannerProperties
from .types.connection import CloudSqlCredential
from .types.connection import CloudSqlProperties
Expand All @@ -36,6 +37,7 @@
"AwsAccessRole",
"AwsCrossAccountRole",
"AwsProperties",
"CloudResourceProperties",
"CloudSpannerProperties",
"CloudSqlCredential",
"CloudSqlProperties",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigquery_connection_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
AwsAccessRole,
AwsCrossAccountRole,
AwsProperties,
CloudResourceProperties,
CloudSpannerProperties,
CloudSqlCredential,
CloudSqlProperties,
Expand All @@ -33,6 +34,7 @@
"AwsAccessRole",
"AwsCrossAccountRole",
"AwsProperties",
"CloudResourceProperties",
"CloudSpannerProperties",
"CloudSqlCredential",
"CloudSqlProperties",
Expand Down
32 changes: 32 additions & 0 deletions google/cloud/bigquery_connection_v1/types/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"AwsProperties",
"AwsCrossAccountRole",
"AwsAccessRole",
"CloudResourceProperties",
},
)

Expand Down Expand Up @@ -175,6 +176,10 @@ class Connection(proto.Message):
cloud_spanner (google.cloud.bigquery_connection_v1.types.CloudSpannerProperties):
Cloud Spanner properties.

This field is a member of `oneof`_ ``properties``.
cloud_resource (google.cloud.bigquery_connection_v1.types.CloudResourceProperties):
Cloud Resource properties.

This field is a member of `oneof`_ ``properties``.
creation_time (int):
Output only. The creation timestamp of the
Expand All @@ -199,6 +204,9 @@ class Connection(proto.Message):
cloud_spanner = proto.Field(
proto.MESSAGE, number=21, oneof="properties", message="CloudSpannerProperties",
)
cloud_resource = proto.Field(
proto.MESSAGE, number=22, oneof="properties", message="CloudResourceProperties",
)
creation_time = proto.Field(proto.INT64, number=5,)
last_modified_time = proto.Field(proto.INT64, number=6,)
has_credential = proto.Field(proto.BOOL, number=7,)
Expand Down Expand Up @@ -339,4 +347,28 @@ class AwsAccessRole(proto.Message):
identity = proto.Field(proto.STRING, number=2,)


class CloudResourceProperties(proto.Message):
r"""Container for connection properties for delegation of access
to GCP resources.

Attributes:
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
permissions to the service account. When the
connection is used in the context of an
operation in BigQuery, the service account will
be used to connect to the desired resources in
GCP.

The account ID is in the form of:
<service-1234>@gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com
"""

service_account_id = proto.Field(proto.STRING, number=1,)


__all__ = tuple(sorted(__protobuf__.manifest))