From 08903367cbe23ce116c2bc93e70c1a1fe4782f45 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:20:03 -0800 Subject: [PATCH] feat: support cross-bucket replication (#7953) PiperOrigin-RevId: 707205525 Source-Link: https://github.com/googleapis/googleapis/commit/67495ab130490fec112841715649b86a7d335e6a Source-Link: https://github.com/googleapis/googleapis-gen/commit/9c2deac940ced28d68c8296d4aeb13139d8ac914 Copy-Tag: eyJwIjoiU3RvcmFnZVRyYW5zZmVyLy5Pd2xCb3QueWFtbCIsImgiOiI5YzJkZWFjOTQwY2VkMjhkNjhjODI5NmQ0YWViMTMxMzlkOGFjOTE0In0= --- StorageTransfer/metadata/V1/Transfer.php | 6 +- StorageTransfer/metadata/V1/TransferTypes.php | Bin 10789 -> 11170 bytes .../list_transfer_jobs.php | 33 ++- StorageTransfer/src/V1/HttpData.php | 42 ++-- .../src/V1/ListTransferJobsRequest.php | 132 +++++++--- StorageTransfer/src/V1/ReplicationSpec.php | 228 ++++++++++++++++++ StorageTransfer/src/V1/TransferJob.php | 44 ++++ 7 files changed, 412 insertions(+), 73 deletions(-) create mode 100644 StorageTransfer/src/V1/ReplicationSpec.php diff --git a/StorageTransfer/metadata/V1/Transfer.php b/StorageTransfer/metadata/V1/Transfer.php index 97a74f5c6dce..1ff0e3450656 100644 --- a/StorageTransfer/metadata/V1/Transfer.php +++ b/StorageTransfer/metadata/V1/Transfer.php @@ -23,7 +23,7 @@ public static function initOnce() { \GPBMetadata\Google\Storagetransfer\V1\TransferTypes::initOnce(); $pool->internalAddGeneratedFile( ' -" +" (google/storagetransfer/v1/transfer.protogoogle.storagetransfer.v1google/api/client.protogoogle/api/field_behavior.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto.google/storagetransfer/v1/transfer_types.proto"9 GetGoogleServiceAccountRequest @@ -102,8 +102,8 @@ public static function initOnce() { GetAgentPool..google.storagetransfer.v1.GetAgentPoolRequest$.google.storagetransfer.v1.AgentPool"1Aname$"/v1/{name=projects/*/agentPools/*} ListAgentPools0.google.storagetransfer.v1.ListAgentPoolsRequest1.google.storagetransfer.v1.ListAgentPoolsResponse";A project_id(&/v1/projects/{project_id=*}/agentPools -DeleteAgentPool1.google.storagetransfer.v1.DeleteAgentPoolRequest.google.protobuf.Empty"1Aname$*"/v1/{name=projects/*/agentPools/*}RAstoragetransfer.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB -#com.google.storagetransfer.v1.protoB TransferProtoZMcloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpbGoogle.Cloud.StorageTransfer.V1Google\\Cloud\\StorageTransfer\\V1"Google::Cloud::StorageTransfer::V1bproto3' +DeleteAgentPool1.google.storagetransfer.v1.DeleteAgentPoolRequest.google.protobuf.Empty"1Aname$*"/v1/{name=projects/*/agentPools/*}RAstoragetransfer.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +#com.google.storagetransfer.v1.protoB TransferProtoZMcloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpbGoogle.Cloud.StorageTransfer.V1Google\\Cloud\\StorageTransfer\\V1"Google::Cloud::StorageTransfer::V1bproto3' , true); static::$is_initialized = true; diff --git a/StorageTransfer/metadata/V1/TransferTypes.php b/StorageTransfer/metadata/V1/TransferTypes.php index 120c424a099b5abc02951e4accf72f15d3591f64..6aab14b3905a6aa63025b7c1c4bbc250a18787b1 100644 GIT binary patch delta 200 zcmZ1)vM78*E;G{;|IPW#8wG^7GjZ_;r55C5CMT9;=H~?$q$W>p6tELv5VGdtO;0Y4 zPf09Ej4#g2%a&l8EFhrC$T<0;kQh6&0;2}Ek@n<^GSZVdg;g0@ChH3u$T;zGaYNMS zmlh?bI&pJx!nJRf7dgt#w2W=?GwC)_7cPM!gr)JtKwBjQC;JO1awEBAa=)6)=4P2h X9`-kkT*}G$xnSGaG?ORiXzm06bqzm) delta 60 zcmV-C0K@;HSEW?2Z36=5OtWtTu@JLb6~qSu;02Q)9fp$>C>OH>9$^dz?*R%UV{dJf S!4?~nhALwN_yGZv=_v} diff --git a/StorageTransfer/samples/V1/StorageTransferServiceClient/list_transfer_jobs.php b/StorageTransfer/samples/V1/StorageTransferServiceClient/list_transfer_jobs.php index 7e1045c83f8d..86751fc3fd08 100644 --- a/StorageTransfer/samples/V1/StorageTransferServiceClient/list_transfer_jobs.php +++ b/StorageTransfer/samples/V1/StorageTransferServiceClient/list_transfer_jobs.php @@ -33,17 +33,32 @@ * Lists transfer jobs. * * @param string $filter A list of query parameters specified as JSON text in the form of: - * `{"projectId":"my_project_id", + * + * ``` + * { + * "projectId":"my_project_id", * "jobNames":["jobid1","jobid2",...], - * "jobStatuses":["status1","status2",...]}` + * "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. * - * 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` 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`. */ function list_transfer_jobs_sample(string $filter): void { diff --git a/StorageTransfer/src/V1/HttpData.php b/StorageTransfer/src/V1/HttpData.php index add9daed9214..6416983f6269 100644 --- a/StorageTransfer/src/V1/HttpData.php +++ b/StorageTransfer/src/V1/HttpData.php @@ -9,33 +9,33 @@ use Google\Protobuf\Internal\GPBUtil; /** - * An HttpData resource specifies a list of objects on the web to be transferred - * over HTTP. The information of the objects to be transferred is contained in - * a file referenced by a URL. The first line in the file must be - * `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent - * lines specify the information of the list of objects, one object per list - * entry. Each entry has the following tab-delimited fields: - * * **HTTP URL** — The location of the object. - * * **Length** — The size of the object in bytes. - * * **MD5** — The base64-encoded MD5 hash of the object. - * For an example of a valid TSV file, see - * [Transferring data from - * URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). - * When transferring data based on a URL list, keep the following in mind: + * An HttpData resource specifies a list of objects on the web to be + * transferred over HTTP. The information of the objects to be transferred is + * contained in a file referenced by a URL. The first line in the file must be + * `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent + * lines specify the information of the list of objects, one object per list + * entry. Each entry has the following tab-delimited fields: + * * **HTTP URL** — The location of the object. + * * **Length** — The size of the object in bytes. + * * **MD5** — The base64-encoded MD5 hash of the object. + * For an example of a valid TSV file, see + * [Transferring data from + * URLs](https://cloud.google.com/storage-transfer/docs/create-url-list). + * When transferring data based on a URL list, keep the following in mind: * * When an object located at `http(s)://hostname:port/` is - * transferred to a data sink, the name of the object at the data sink is + * transferred to a data sink, the name of the object at the data sink is * `/`. * * If the specified size of an object does not match the actual size of the - * object fetched, the object is not transferred. + * object fetched, the object is not transferred. * * If the specified MD5 does not match the MD5 computed from the transferred - * bytes, the object transfer fails. + * bytes, the object transfer fails. * * Ensure that each URL you specify is publicly accessible. For - * example, in Cloud Storage you can - * [share an object publicly] - * (/storage/docs/cloud-console#_sharingdata) and get a link to it. + * example, in Cloud Storage you can + * [share an object publicly] + * (/storage/docs/cloud-console#_sharingdata) and get a link to it. * * Storage Transfer Service obeys `robots.txt` rules and requires the source - * HTTP server to support `Range` requests and to return a `Content-Length` - * header in each response. + * HTTP server to support `Range` requests and to return a `Content-Length` + * header in each response. * * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no * effect when filtering objects to transfer. * diff --git a/StorageTransfer/src/V1/ListTransferJobsRequest.php b/StorageTransfer/src/V1/ListTransferJobsRequest.php index 1709bfb490ac..b8cd19e45d64 100644 --- a/StorageTransfer/src/V1/ListTransferJobsRequest.php +++ b/StorageTransfer/src/V1/ListTransferJobsRequest.php @@ -18,16 +18,29 @@ class ListTransferJobsRequest extends \Google\Protobuf\Internal\Message { /** * 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`. * * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -53,16 +66,29 @@ class ListTransferJobsRequest extends \Google\Protobuf\Internal\Message * * @type string $filter * 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`. * @type int $page_size * The list page size. The max allowed value is 256. * @type string $page_token @@ -76,16 +102,29 @@ public function __construct($data = NULL) { /** * 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`. * * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -97,16 +136,29 @@ public function getFilter() /** * 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`. * * Generated from protobuf field string filter = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/StorageTransfer/src/V1/ReplicationSpec.php b/StorageTransfer/src/V1/ReplicationSpec.php new file mode 100644 index 000000000000..e63ae811fda2 --- /dev/null +++ b/StorageTransfer/src/V1/ReplicationSpec.php @@ -0,0 +1,228 @@ +google.storagetransfer.v1.ReplicationSpec + */ +class ReplicationSpec extends \Google\Protobuf\Internal\Message +{ + /** + * Object conditions that determine which objects are transferred. For + * replication jobs, only `include_prefixes` and `exclude_prefixes` are + * supported. + * + * Generated from protobuf field .google.storagetransfer.v1.ObjectConditions object_conditions = 3; + */ + protected $object_conditions = null; + /** + * 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. + * + * Generated from protobuf field .google.storagetransfer.v1.TransferOptions transfer_options = 4; + */ + protected $transfer_options = null; + protected $data_source; + protected $data_sink; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\StorageTransfer\V1\GcsData $gcs_data_source + * The Cloud Storage bucket from which to replicate objects. + * @type \Google\Cloud\StorageTransfer\V1\GcsData $gcs_data_sink + * The Cloud Storage bucket to which to replicate objects. + * @type \Google\Cloud\StorageTransfer\V1\ObjectConditions $object_conditions + * Object conditions that determine which objects are transferred. For + * replication jobs, only `include_prefixes` and `exclude_prefixes` are + * supported. + * @type \Google\Cloud\StorageTransfer\V1\TransferOptions $transfer_options + * 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Storagetransfer\V1\TransferTypes::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud Storage bucket from which to replicate objects. + * + * Generated from protobuf field .google.storagetransfer.v1.GcsData gcs_data_source = 1; + * @return \Google\Cloud\StorageTransfer\V1\GcsData|null + */ + public function getGcsDataSource() + { + return $this->readOneof(1); + } + + public function hasGcsDataSource() + { + return $this->hasOneof(1); + } + + /** + * The Cloud Storage bucket from which to replicate objects. + * + * Generated from protobuf field .google.storagetransfer.v1.GcsData gcs_data_source = 1; + * @param \Google\Cloud\StorageTransfer\V1\GcsData $var + * @return $this + */ + public function setGcsDataSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\StorageTransfer\V1\GcsData::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The Cloud Storage bucket to which to replicate objects. + * + * Generated from protobuf field .google.storagetransfer.v1.GcsData gcs_data_sink = 2; + * @return \Google\Cloud\StorageTransfer\V1\GcsData|null + */ + public function getGcsDataSink() + { + return $this->readOneof(2); + } + + public function hasGcsDataSink() + { + return $this->hasOneof(2); + } + + /** + * The Cloud Storage bucket to which to replicate objects. + * + * Generated from protobuf field .google.storagetransfer.v1.GcsData gcs_data_sink = 2; + * @param \Google\Cloud\StorageTransfer\V1\GcsData $var + * @return $this + */ + public function setGcsDataSink($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\StorageTransfer\V1\GcsData::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Object conditions that determine which objects are transferred. For + * replication jobs, only `include_prefixes` and `exclude_prefixes` are + * supported. + * + * Generated from protobuf field .google.storagetransfer.v1.ObjectConditions object_conditions = 3; + * @return \Google\Cloud\StorageTransfer\V1\ObjectConditions|null + */ + public function getObjectConditions() + { + return $this->object_conditions; + } + + public function hasObjectConditions() + { + return isset($this->object_conditions); + } + + public function clearObjectConditions() + { + unset($this->object_conditions); + } + + /** + * Object conditions that determine which objects are transferred. For + * replication jobs, only `include_prefixes` and `exclude_prefixes` are + * supported. + * + * Generated from protobuf field .google.storagetransfer.v1.ObjectConditions object_conditions = 3; + * @param \Google\Cloud\StorageTransfer\V1\ObjectConditions $var + * @return $this + */ + public function setObjectConditions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\StorageTransfer\V1\ObjectConditions::class); + $this->object_conditions = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field .google.storagetransfer.v1.TransferOptions transfer_options = 4; + * @return \Google\Cloud\StorageTransfer\V1\TransferOptions|null + */ + public function getTransferOptions() + { + return $this->transfer_options; + } + + public function hasTransferOptions() + { + return isset($this->transfer_options); + } + + public function clearTransferOptions() + { + unset($this->transfer_options); + } + + /** + * 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. + * + * Generated from protobuf field .google.storagetransfer.v1.TransferOptions transfer_options = 4; + * @param \Google\Cloud\StorageTransfer\V1\TransferOptions $var + * @return $this + */ + public function setTransferOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\StorageTransfer\V1\TransferOptions::class); + $this->transfer_options = $var; + + return $this; + } + + /** + * @return string + */ + public function getDataSource() + { + return $this->whichOneof("data_source"); + } + + /** + * @return string + */ + public function getDataSink() + { + return $this->whichOneof("data_sink"); + } + +} + diff --git a/StorageTransfer/src/V1/TransferJob.php b/StorageTransfer/src/V1/TransferJob.php index efc91b2f5ac8..b2bbc2e9c523 100644 --- a/StorageTransfer/src/V1/TransferJob.php +++ b/StorageTransfer/src/V1/TransferJob.php @@ -59,6 +59,12 @@ class TransferJob extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.storagetransfer.v1.TransferSpec transfer_spec = 4; */ protected $transfer_spec = null; + /** + * Replication specification. + * + * Generated from protobuf field .google.storagetransfer.v1.ReplicationSpec replication_spec = 17; + */ + protected $replication_spec = null; /** * Notification configuration. * @@ -159,6 +165,8 @@ class TransferJob extends \Google\Protobuf\Internal\Message * The ID of the Google Cloud project that owns the job. * @type \Google\Cloud\StorageTransfer\V1\TransferSpec $transfer_spec * Transfer specification. + * @type \Google\Cloud\StorageTransfer\V1\ReplicationSpec $replication_spec + * Replication specification. * @type \Google\Cloud\StorageTransfer\V1\NotificationConfig $notification_config * Notification configuration. * @type \Google\Cloud\StorageTransfer\V1\LoggingConfig $logging_config @@ -348,6 +356,42 @@ public function setTransferSpec($var) return $this; } + /** + * Replication specification. + * + * Generated from protobuf field .google.storagetransfer.v1.ReplicationSpec replication_spec = 17; + * @return \Google\Cloud\StorageTransfer\V1\ReplicationSpec|null + */ + public function getReplicationSpec() + { + return $this->replication_spec; + } + + public function hasReplicationSpec() + { + return isset($this->replication_spec); + } + + public function clearReplicationSpec() + { + unset($this->replication_spec); + } + + /** + * Replication specification. + * + * Generated from protobuf field .google.storagetransfer.v1.ReplicationSpec replication_spec = 17; + * @param \Google\Cloud\StorageTransfer\V1\ReplicationSpec $var + * @return $this + */ + public function setReplicationSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\StorageTransfer\V1\ReplicationSpec::class); + $this->replication_spec = $var; + + return $this; + } + /** * Notification configuration. *