Skip to content

Commit

Permalink
feat: add EncryptionConfiguration to TransferConfig (#486)
Browse files Browse the repository at this point in the history
* feat: add EncryptionConfiguration to TransferConfig

---
feat: Add List type to Data source parameter.
PiperOrigin-RevId: 552543247

Source-Link: googleapis/googleapis@95f0f2b

Source-Link: googleapis/googleapis-gen@3199b46
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzE5OWI0NjM2NjhiZjczMGQyYTQyNzg5YzMyYjg4ZmI5NGVmOGY0NCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 31, 2023
1 parent 5a9c6d6 commit 4f32479
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
)
from google.cloud.bigquery_datatransfer_v1.types.transfer import (
EmailPreferences,
EncryptionConfiguration,
ScheduleOptions,
TransferConfig,
TransferMessage,
Expand Down Expand Up @@ -89,6 +90,7 @@
"StartManualTransferRunsResponse",
"UpdateTransferConfigRequest",
"EmailPreferences",
"EncryptionConfiguration",
"ScheduleOptions",
"TransferConfig",
"TransferMessage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
)
from .types.transfer import (
EmailPreferences,
EncryptionConfiguration,
ScheduleOptions,
TransferConfig,
TransferMessage,
Expand All @@ -70,6 +71,7 @@
"DeleteTransferConfigRequest",
"DeleteTransferRunRequest",
"EmailPreferences",
"EncryptionConfiguration",
"EnrollDataSourcesRequest",
"GetDataSourceRequest",
"GetTransferConfigRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
)
from .transfer import (
EmailPreferences,
EncryptionConfiguration,
ScheduleOptions,
TransferConfig,
TransferMessage,
Expand Down Expand Up @@ -76,6 +77,7 @@
"StartManualTransferRunsResponse",
"UpdateTransferConfigRequest",
"EmailPreferences",
"EncryptionConfiguration",
"ScheduleOptions",
"TransferConfig",
"TransferMessage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ class Type(proto.Enum):
Deprecated. This field has no effect.
PLUS_PAGE (6):
Page ID for a Google+ Page.
LIST (7):
List of strings parameter.
"""
TYPE_UNSPECIFIED = 0
STRING = 1
Expand All @@ -130,6 +132,7 @@ class Type(proto.Enum):
BOOLEAN = 4
RECORD = 5
PLUS_PAGE = 6
LIST = 7

param_id: str = proto.Field(
proto.STRING,
Expand Down Expand Up @@ -1064,13 +1067,17 @@ class StartManualTransferRunsRequest(proto.Message):
``projects/{project_id}/transferConfigs/{config_id}`` or
``projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}``.
requested_time_range (google.cloud.bigquery_datatransfer_v1.types.StartManualTransferRunsRequest.TimeRange):
Time range for the transfer runs that should
be started.
A time_range start and end timestamp for historical data
files or reports that are scheduled to be transferred by the
scheduled transfer run. requested_time_range must be a past
time and cannot include future time values.
This field is a member of `oneof`_ ``time``.
requested_run_time (google.protobuf.timestamp_pb2.Timestamp):
Specific run_time for a transfer run to be started. The
requested_run_time must not be in the future.
A run_time timestamp for historical data files or reports
that are scheduled to be transferred by the scheduled
transfer run. requested_run_time must be a past time and
cannot include future time values.
This field is a member of `oneof`_ ``time``.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.protobuf import wrappers_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore
import proto # type: ignore

Expand All @@ -31,6 +32,7 @@
"ScheduleOptions",
"UserInfo",
"TransferConfig",
"EncryptionConfiguration",
"TransferRun",
"TransferMessage",
},
Expand Down Expand Up @@ -262,6 +264,15 @@ class TransferConfig(proto.Message):
populated.
This field is a member of `oneof`_ ``_owner_info``.
encryption_configuration (google.cloud.bigquery_datatransfer_v1.types.EncryptionConfiguration):
The encryption configuration part. Currently,
it is only used for the optional KMS key name.
The BigQuery service account of your project
must be granted permissions to use the key. Read
methods will return the key name applied in
effect. Write methods will apply the key if it
is present, or otherwise try to apply project
default keys if it is absent.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -341,6 +352,27 @@ class TransferConfig(proto.Message):
optional=True,
message="UserInfo",
)
encryption_configuration: "EncryptionConfiguration" = proto.Field(
proto.MESSAGE,
number=28,
message="EncryptionConfiguration",
)


class EncryptionConfiguration(proto.Message):
r"""Represents the encryption configuration for a transfer.
Attributes:
kms_key_name (google.protobuf.wrappers_pb2.StringValue):
The name of the KMS key used for encrypting
BigQuery data.
"""

kms_key_name: wrappers_pb2.StringValue = proto.Field(
proto.MESSAGE,
number=1,
message=wrappers_pb2.StringValue,
)


class TransferRun(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from google.protobuf import json_format
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.protobuf import wrappers_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore
import grpc
from grpc.experimental import aio
Expand Down Expand Up @@ -5923,6 +5924,7 @@ def test_create_transfer_config_rest(request_type):
"notification_pubsub_topic": "notification_pubsub_topic_value",
"email_preferences": {"enable_failure_email": True},
"owner_info": {"email": "email_value"},
"encryption_configuration": {"kms_key_name": {"value": "value_value"}},
}
request = request_type(**request_init)

Expand Down Expand Up @@ -6165,6 +6167,7 @@ def test_create_transfer_config_rest_bad_request(
"notification_pubsub_topic": "notification_pubsub_topic_value",
"email_preferences": {"enable_failure_email": True},
"owner_info": {"email": "email_value"},
"encryption_configuration": {"kms_key_name": {"value": "value_value"}},
}
request = request_type(**request_init)

Expand Down Expand Up @@ -6285,6 +6288,7 @@ def test_update_transfer_config_rest(request_type):
"notification_pubsub_topic": "notification_pubsub_topic_value",
"email_preferences": {"enable_failure_email": True},
"owner_info": {"email": "email_value"},
"encryption_configuration": {"kms_key_name": {"value": "value_value"}},
}
request = request_type(**request_init)

Expand Down Expand Up @@ -6528,6 +6532,7 @@ def test_update_transfer_config_rest_bad_request(
"notification_pubsub_topic": "notification_pubsub_topic_value",
"email_preferences": {"enable_failure_email": True},
"owner_info": {"email": "email_value"},
"encryption_configuration": {"kms_key_name": {"value": "value_value"}},
}
request = request_type(**request_init)

Expand Down

0 comments on commit 4f32479

Please sign in to comment.