diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/__init__.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/__init__.py index 1a2c93651b70..4f04e535973b 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/__init__.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/__init__.py @@ -61,6 +61,7 @@ NotificationConfig, ObjectConditions, PosixFilesystem, + ReplicationSpec, S3CompatibleMetadata, Schedule, TransferCounters, @@ -108,6 +109,7 @@ "NotificationConfig", "ObjectConditions", "PosixFilesystem", + "ReplicationSpec", "S3CompatibleMetadata", "Schedule", "TransferCounters", diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/gapic_version.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/gapic_version.py index 2159c8af6f8e..558c8aab67c5 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/gapic_version.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/__init__.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/__init__.py index ceffe4431dab..04d5afcf58cf 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/__init__.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/__init__.py @@ -59,6 +59,7 @@ NotificationConfig, ObjectConditions, PosixFilesystem, + ReplicationSpec, S3CompatibleMetadata, Schedule, TransferCounters, @@ -101,6 +102,7 @@ "ObjectConditions", "PauseTransferOperationRequest", "PosixFilesystem", + "ReplicationSpec", "ResumeTransferOperationRequest", "RunTransferJobRequest", "S3CompatibleMetadata", diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/gapic_version.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/gapic_version.py index 2159c8af6f8e..558c8aab67c5 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/gapic_version.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.14.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/__init__.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/__init__.py index 214350808552..24f6fb0891f1 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/__init__.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/__init__.py @@ -50,6 +50,7 @@ NotificationConfig, ObjectConditions, PosixFilesystem, + ReplicationSpec, S3CompatibleMetadata, Schedule, TransferCounters, @@ -95,6 +96,7 @@ "NotificationConfig", "ObjectConditions", "PosixFilesystem", + "ReplicationSpec", "S3CompatibleMetadata", "Schedule", "TransferCounters", diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer.py index ba3b0c301701..a6bb49e2cc3b 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer.py @@ -185,17 +185,36 @@ class ListTransferJobsRequest(proto.Message): filter (str): Required. A list of query parameters specified as JSON text in the form of: - ``{"projectId":"my_project_id", "jobNames":["jobid1","jobid2",...], "jobStatuses":["status1","status2",...]}`` - - Since ``jobNames`` and ``jobStatuses`` support multiple - values, their values must be specified with array notation. - ``projectId`` is required. ``jobNames`` and ``jobStatuses`` - are optional. The valid values for ``jobStatuses`` are - case-insensitive: - [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED], - [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], - and - [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]. + + :: + + { + "projectId":"my_project_id", + "jobNames":["jobid1","jobid2",...], + "jobStatuses":["status1","status2",...], + "dataBackend":"QUERY_REPLICATION_CONFIGS", + "sourceBucket":"source-bucket-name", + "sinkBucket":"sink-bucket-name", + } + + The JSON formatting in the example is for display only; + provide the query parameters without spaces or line breaks. + + - ``projectId`` is required. + - Since ``jobNames`` and ``jobStatuses`` support multiple + values, their values must be specified with array + notation. ``jobNames`` and ``jobStatuses`` are optional. + Valid values are case-insensitive: + + - [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED] + - [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED] + - [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] + + - Specify ``"dataBackend":"QUERY_REPLICATION_CONFIGS"`` to + return a list of cross-bucket replication jobs. + - Limit the results to jobs from a particular bucket with + ``sourceBucket`` and/or to a particular bucket with + ``sinkBucket``. page_size (int): The list page size. The max allowed value is 256. diff --git a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer_types.py b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer_types.py index b398ef85c01f..cfee4d4febb3 100644 --- a/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer_types.py +++ b/packages/google-cloud-storage-transfer/google/cloud/storage_transfer_v1/types/transfer_types.py @@ -42,6 +42,7 @@ "AgentPool", "TransferOptions", "TransferSpec", + "ReplicationSpec", "MetadataOptions", "TransferManifest", "Schedule", @@ -1113,6 +1114,62 @@ class TransferSpec(proto.Message): ) +class ReplicationSpec(proto.Message): + r"""Specifies the configuration for a cross-bucket replication + job. Cross-bucket replication copies new or updated objects from + a source Cloud Storage bucket to a destination Cloud Storage + bucket. Existing objects in the source bucket are not copied by + a new cross-bucket replication job. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_data_source (google.cloud.storage_transfer_v1.types.GcsData): + The Cloud Storage bucket from which to + replicate objects. + + This field is a member of `oneof`_ ``data_source``. + gcs_data_sink (google.cloud.storage_transfer_v1.types.GcsData): + The Cloud Storage bucket to which to + replicate objects. + + This field is a member of `oneof`_ ``data_sink``. + object_conditions (google.cloud.storage_transfer_v1.types.ObjectConditions): + Object conditions that determine which objects are + transferred. For replication jobs, only ``include_prefixes`` + and ``exclude_prefixes`` are supported. + transfer_options (google.cloud.storage_transfer_v1.types.TransferOptions): + Specifies the metadata options to be applied during + replication. Delete options are not supported. If a delete + option is specified, the request fails with an + [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error. + """ + + gcs_data_source: "GcsData" = proto.Field( + proto.MESSAGE, + number=1, + oneof="data_source", + message="GcsData", + ) + gcs_data_sink: "GcsData" = proto.Field( + proto.MESSAGE, + number=2, + oneof="data_sink", + message="GcsData", + ) + object_conditions: "ObjectConditions" = proto.Field( + proto.MESSAGE, + number=3, + message="ObjectConditions", + ) + transfer_options: "TransferOptions" = proto.Field( + proto.MESSAGE, + number=4, + message="TransferOptions", + ) + + class MetadataOptions(proto.Message): r"""Specifies the metadata options for running a transfer. @@ -1604,6 +1661,8 @@ class TransferJob(proto.Message): the job. transfer_spec (google.cloud.storage_transfer_v1.types.TransferSpec): Transfer specification. + replication_spec (google.cloud.storage_transfer_v1.types.ReplicationSpec): + Replication specification. notification_config (google.cloud.storage_transfer_v1.types.NotificationConfig): Notification configuration. logging_config (google.cloud.storage_transfer_v1.types.LoggingConfig): @@ -1686,6 +1745,11 @@ class Status(proto.Enum): number=4, message="TransferSpec", ) + replication_spec: "ReplicationSpec" = proto.Field( + proto.MESSAGE, + number=17, + message="ReplicationSpec", + ) notification_config: "NotificationConfig" = proto.Field( proto.MESSAGE, number=11, diff --git a/packages/google-cloud-storage-transfer/samples/generated_samples/snippet_metadata_google.storagetransfer.v1.json b/packages/google-cloud-storage-transfer/samples/generated_samples/snippet_metadata_google.storagetransfer.v1.json index 36a02bf4d835..99925243876a 100644 --- a/packages/google-cloud-storage-transfer/samples/generated_samples/snippet_metadata_google.storagetransfer.v1.json +++ b/packages/google-cloud-storage-transfer/samples/generated_samples/snippet_metadata_google.storagetransfer.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-storage-transfer", - "version": "1.14.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-storage-transfer/tests/unit/gapic/storage_transfer_v1/test_storage_transfer_service.py b/packages/google-cloud-storage-transfer/tests/unit/gapic/storage_transfer_v1/test_storage_transfer_service.py index 761e0faf5122..0921ff619ea8 100644 --- a/packages/google-cloud-storage-transfer/tests/unit/gapic/storage_transfer_v1/test_storage_transfer_service.py +++ b/packages/google-cloud-storage-transfer/tests/unit/gapic/storage_transfer_v1/test_storage_transfer_service.py @@ -8766,6 +8766,12 @@ def test_create_transfer_job_rest_call_success(request_type): "source_agent_pool_name": "source_agent_pool_name_value", "sink_agent_pool_name": "sink_agent_pool_name_value", }, + "replication_spec": { + "gcs_data_source": {}, + "gcs_data_sink": {}, + "object_conditions": {}, + "transfer_options": {}, + }, "notification_config": { "pubsub_topic": "pubsub_topic_value", "event_types": [1],