From 792186d864789661a5331a97b94d002cd4744a67 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 17 Dec 2024 21:44:39 +0000 Subject: [PATCH 1/2] chore!: promote Dataflow to v2 --- .repo-metadata-full.json | 4 +- Dataflow/.OwlBot.yaml | 4 +- Dataflow/README.md | 5 +- Dataflow/owlbot.py | 43 +- Dataflow/src/V1beta3/AutoscalingEvent.php | 12 +- .../AutoscalingEvent/AutoscalingEventType.php | 2 - .../AutoscalingEvent_AutoscalingEventType.php | 16 - Dataflow/src/V1beta3/AutoscalingSettings.php | 4 +- Dataflow/src/V1beta3/BigQueryIODetails.php | 8 +- Dataflow/src/V1beta3/BigTableIODetails.php | 6 +- .../src/V1beta3/CheckActiveJobsRequest.php | 2 +- .../src/V1beta3/CheckActiveJobsResponse.php | 2 +- .../Client/FlexTemplatesServiceClient.php | 12 +- .../src/V1beta3/Client/JobsV1Beta3Client.php | 6 +- .../V1beta3/Client/MessagesV1Beta3Client.php | 6 +- .../V1beta3/Client/MetricsV1Beta3Client.php | 18 +- .../V1beta3/Client/SnapshotsV1Beta3Client.php | 6 +- .../V1beta3/Client/TemplatesServiceClient.php | 6 +- Dataflow/src/V1beta3/ComputationTopology.php | 4 +- Dataflow/src/V1beta3/ContainerSpec.php | 8 +- .../V1beta3/CreateJobFromTemplateRequest.php | 8 +- Dataflow/src/V1beta3/CreateJobRequest.php | 10 +- Dataflow/src/V1beta3/CustomSourceLocation.php | 2 +- Dataflow/src/V1beta3/DataDiskAssignment.php | 2 +- Dataflow/src/V1beta3/DatastoreIODetails.php | 4 +- Dataflow/src/V1beta3/DebugOptions.php | 2 +- .../src/V1beta3/DeleteSnapshotRequest.php | 6 +- Dataflow/src/V1beta3/Disk.php | 6 +- Dataflow/src/V1beta3/DisplayData.php | 10 +- .../V1beta3/DynamicTemplateLaunchParams.php | 4 +- Dataflow/src/V1beta3/Environment.php | 28 +- Dataflow/src/V1beta3/ExecutionStageState.php | 6 +- .../src/V1beta3/ExecutionStageSummary.php | 6 +- .../ExecutionStageSummary/ComponentSource.php | 8 +- .../ComponentTransform.php | 8 +- .../ExecutionStageSummary/StageSource.php | 10 +- .../ExecutionStageSummary_ComponentSource.php | 16 - ...ecutionStageSummary_ComponentTransform.php | 16 - .../ExecutionStageSummary_StageSource.php | 16 - Dataflow/src/V1beta3/FailedLocation.php | 2 +- Dataflow/src/V1beta3/FileIODetails.php | 2 +- .../FlexTemplateRuntimeEnvironment.php | 42 +- .../V1beta3/FlexTemplatesServiceClient.php | 36 - .../FlexTemplatesServiceGrpcClient.php | 50 -- .../Gapic/FlexTemplatesServiceGapicClient.php | 255 ------ .../V1beta3/Gapic/JobsV1Beta3GapicClient.php | 798 ------------------ .../Gapic/MessagesV1Beta3GapicClient.php | 316 ------- .../Gapic/MetricsV1Beta3GapicClient.php | 497 ----------- .../Gapic/SnapshotsV1Beta3GapicClient.php | 382 --------- .../Gapic/TemplatesServiceGapicClient.php | 439 ---------- .../V1beta3/GetJobExecutionDetailsRequest.php | 10 +- Dataflow/src/V1beta3/GetJobMetricsRequest.php | 8 +- Dataflow/src/V1beta3/GetJobRequest.php | 8 +- Dataflow/src/V1beta3/GetSnapshotRequest.php | 6 +- .../GetStageExecutionDetailsRequest.php | 16 +- Dataflow/src/V1beta3/GetTemplateRequest.php | 6 +- .../GetTemplateRequest/TemplateView.php | 2 - .../GetTemplateRequest_TemplateView.php | 16 - Dataflow/src/V1beta3/GetTemplateResponse.php | 8 +- .../GetTemplateResponse/TemplateType.php | 2 - .../GetTemplateResponse_TemplateType.php | 16 - .../ParameterViolation.php | 6 +- ...dTemplateParameters_ParameterViolation.php | 16 - Dataflow/src/V1beta3/Job.php | 40 +- Dataflow/src/V1beta3/JobExecutionDetails.php | 2 +- Dataflow/src/V1beta3/JobMessage.php | 8 +- Dataflow/src/V1beta3/JobMetadata.php | 2 +- Dataflow/src/V1beta3/JobMetrics.php | 2 +- Dataflow/src/V1beta3/JobsV1Beta3Client.php | 36 - .../src/V1beta3/JobsV1Beta3GrpcClient.php | 166 ---- .../V1beta3/KeyRangeDataDiskAssignment.php | 6 +- Dataflow/src/V1beta3/KeyRangeLocation.php | 8 +- .../V1beta3/LaunchFlexTemplateParameter.php | 6 +- .../src/V1beta3/LaunchFlexTemplateRequest.php | 8 +- .../V1beta3/LaunchFlexTemplateResponse.php | 2 +- .../src/V1beta3/LaunchTemplateParameters.php | 6 +- .../src/V1beta3/LaunchTemplateRequest.php | 8 +- .../src/V1beta3/LaunchTemplateResponse.php | 2 +- .../src/V1beta3/ListJobMessagesRequest.php | 16 +- .../src/V1beta3/ListJobMessagesResponse.php | 2 +- Dataflow/src/V1beta3/ListJobsRequest.php | 10 +- .../src/V1beta3/ListJobsRequest/Filter.php | 2 - .../src/V1beta3/ListJobsRequest_Filter.php | 16 - Dataflow/src/V1beta3/ListJobsResponse.php | 2 +- Dataflow/src/V1beta3/ListSnapshotsRequest.php | 6 +- .../src/V1beta3/MessagesV1Beta3Client.php | 36 - .../src/V1beta3/MessagesV1Beta3GrpcClient.php | 57 -- Dataflow/src/V1beta3/MetricStructuredName.php | 4 +- Dataflow/src/V1beta3/MetricUpdate.php | 22 +- Dataflow/src/V1beta3/MetricsV1Beta3Client.php | 36 - .../src/V1beta3/MetricsV1Beta3GrpcClient.php | 92 -- Dataflow/src/V1beta3/MountedDataDisk.php | 2 +- Dataflow/src/V1beta3/Package.php | 4 +- Dataflow/src/V1beta3/ParameterMetadata.php | 10 +- Dataflow/src/V1beta3/ProgressTimeseries.php | 2 +- .../src/V1beta3/ProgressTimeseries/Point.php | 6 +- .../src/V1beta3/ProgressTimeseries_Point.php | 16 - Dataflow/src/V1beta3/PubSubIODetails.php | 4 +- Dataflow/src/V1beta3/PubsubLocation.php | 14 +- .../src/V1beta3/PubsubSnapshotMetadata.php | 6 +- Dataflow/src/V1beta3/RuntimeEnvironment.php | 28 +- Dataflow/src/V1beta3/RuntimeMetadata.php | 2 +- Dataflow/src/V1beta3/SDKInfo.php | 4 +- Dataflow/src/V1beta3/SDKInfo/Language.php | 2 - Dataflow/src/V1beta3/SDKInfo_Language.php | 16 - .../src/V1beta3/SdkHarnessContainerImage.php | 6 +- Dataflow/src/V1beta3/SdkVersion.php | 6 +- .../V1beta3/SdkVersion/SdkSupportStatus.php | 2 - .../V1beta3/SdkVersion_SdkSupportStatus.php | 16 - Dataflow/src/V1beta3/Snapshot.php | 18 +- Dataflow/src/V1beta3/SnapshotJobRequest.php | 12 +- .../src/V1beta3/SnapshotsV1Beta3Client.php | 36 - .../V1beta3/SnapshotsV1Beta3GrpcClient.php | 80 -- Dataflow/src/V1beta3/SpannerIODetails.php | 6 +- .../src/V1beta3/StageExecutionDetails.php | 2 +- Dataflow/src/V1beta3/StageSummary.php | 10 +- Dataflow/src/V1beta3/StateFamilyConfig.php | 4 +- Dataflow/src/V1beta3/Step.php | 6 +- .../StreamingApplianceSnapshotConfig.php | 4 +- .../V1beta3/StreamingComputationRanges.php | 2 +- .../V1beta3/StreamingSideInputLocation.php | 4 +- .../src/V1beta3/StreamingStageLocation.php | 2 +- Dataflow/src/V1beta3/StructuredMessage.php | 4 +- .../V1beta3/StructuredMessage/Parameter.php | 6 +- .../V1beta3/StructuredMessage_Parameter.php | 16 - Dataflow/src/V1beta3/TaskRunnerSettings.php | 36 +- Dataflow/src/V1beta3/TemplateMetadata.php | 4 +- .../src/V1beta3/TemplatesServiceClient.php | 36 - .../V1beta3/TemplatesServiceGrpcClient.php | 80 -- Dataflow/src/V1beta3/TopologyConfig.php | 4 +- Dataflow/src/V1beta3/TransformSummary.php | 6 +- Dataflow/src/V1beta3/UpdateJobRequest.php | 8 +- Dataflow/src/V1beta3/WorkItemDetails.php | 12 +- Dataflow/src/V1beta3/WorkerDetails.php | 2 +- Dataflow/src/V1beta3/WorkerPool.php | 36 +- Dataflow/src/V1beta3/WorkerSettings.php | 12 +- .../Client/FlexTemplatesServiceClientTest.php | 21 +- .../V1beta3/Client/JobsV1Beta3ClientTest.php | 123 +-- .../Client/MessagesV1Beta3ClientTest.php | 29 +- .../Client/MetricsV1Beta3ClientTest.php | 63 +- .../Client/SnapshotsV1Beta3ClientTest.php | 51 +- .../Client/TemplatesServiceClientTest.php | 51 +- .../FlexTemplatesServiceClientTest.php | 113 --- .../Unit/V1beta3/JobsV1Beta3ClientTest.php | 522 ------------ .../V1beta3/MessagesV1Beta3ClientTest.php | 124 --- .../Unit/V1beta3/MetricsV1Beta3ClientTest.php | 241 ------ .../V1beta3/SnapshotsV1Beta3ClientTest.php | 231 ----- .../V1beta3/TemplatesServiceClientTest.php | 239 ------ 148 files changed, 590 insertions(+), 5696 deletions(-) delete mode 100644 Dataflow/src/V1beta3/AutoscalingEvent_AutoscalingEventType.php delete mode 100644 Dataflow/src/V1beta3/ExecutionStageSummary_ComponentSource.php delete mode 100644 Dataflow/src/V1beta3/ExecutionStageSummary_ComponentTransform.php delete mode 100644 Dataflow/src/V1beta3/ExecutionStageSummary_StageSource.php delete mode 100644 Dataflow/src/V1beta3/FlexTemplatesServiceClient.php delete mode 100644 Dataflow/src/V1beta3/FlexTemplatesServiceGrpcClient.php delete mode 100644 Dataflow/src/V1beta3/Gapic/FlexTemplatesServiceGapicClient.php delete mode 100644 Dataflow/src/V1beta3/Gapic/JobsV1Beta3GapicClient.php delete mode 100644 Dataflow/src/V1beta3/Gapic/MessagesV1Beta3GapicClient.php delete mode 100644 Dataflow/src/V1beta3/Gapic/MetricsV1Beta3GapicClient.php delete mode 100644 Dataflow/src/V1beta3/Gapic/SnapshotsV1Beta3GapicClient.php delete mode 100644 Dataflow/src/V1beta3/Gapic/TemplatesServiceGapicClient.php delete mode 100644 Dataflow/src/V1beta3/GetTemplateRequest_TemplateView.php delete mode 100644 Dataflow/src/V1beta3/GetTemplateResponse_TemplateType.php delete mode 100644 Dataflow/src/V1beta3/InvalidTemplateParameters_ParameterViolation.php delete mode 100644 Dataflow/src/V1beta3/JobsV1Beta3Client.php delete mode 100644 Dataflow/src/V1beta3/JobsV1Beta3GrpcClient.php delete mode 100644 Dataflow/src/V1beta3/ListJobsRequest_Filter.php delete mode 100644 Dataflow/src/V1beta3/MessagesV1Beta3Client.php delete mode 100644 Dataflow/src/V1beta3/MessagesV1Beta3GrpcClient.php delete mode 100644 Dataflow/src/V1beta3/MetricsV1Beta3Client.php delete mode 100644 Dataflow/src/V1beta3/MetricsV1Beta3GrpcClient.php delete mode 100644 Dataflow/src/V1beta3/ProgressTimeseries_Point.php delete mode 100644 Dataflow/src/V1beta3/SDKInfo_Language.php delete mode 100644 Dataflow/src/V1beta3/SdkVersion_SdkSupportStatus.php delete mode 100644 Dataflow/src/V1beta3/SnapshotsV1Beta3Client.php delete mode 100644 Dataflow/src/V1beta3/SnapshotsV1Beta3GrpcClient.php delete mode 100644 Dataflow/src/V1beta3/StructuredMessage_Parameter.php delete mode 100644 Dataflow/src/V1beta3/TemplatesServiceClient.php delete mode 100644 Dataflow/src/V1beta3/TemplatesServiceGrpcClient.php delete mode 100644 Dataflow/tests/Unit/V1beta3/FlexTemplatesServiceClientTest.php delete mode 100644 Dataflow/tests/Unit/V1beta3/JobsV1Beta3ClientTest.php delete mode 100644 Dataflow/tests/Unit/V1beta3/MessagesV1Beta3ClientTest.php delete mode 100644 Dataflow/tests/Unit/V1beta3/MetricsV1Beta3ClientTest.php delete mode 100644 Dataflow/tests/Unit/V1beta3/SnapshotsV1Beta3ClientTest.php delete mode 100644 Dataflow/tests/Unit/V1beta3/TemplatesServiceClientTest.php diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 47293b0e4b2a..2033d4be21e9 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -509,7 +509,7 @@ "Dataflow": { "language": "php", "distribution_name": "google/cloud-dataflow", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataflow/latest", "library_type": "GAPIC_AUTO", "api_shortname": "dataflow" @@ -1599,4 +1599,4 @@ "library_type": "GAPIC_AUTO", "api_shortname": "workflows" } -} +} \ No newline at end of file diff --git a/Dataflow/.OwlBot.yaml b/Dataflow/.OwlBot.yaml index 10587c884c40..c8a85c32f20b 100644 --- a/Dataflow/.OwlBot.yaml +++ b/Dataflow/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/dataflow/v1beta3/.*-php/(.*) - dest: /owl-bot-staging/Dataflow/v1beta3/$1 + - source: /google/dataflow/(v1beta3)/.*-php/(.*) + dest: /owl-bot-staging/Dataflow/$1/$2 api-name: Dataflow diff --git a/Dataflow/README.md b/Dataflow/README.md index 9896c2cd6763..abed96bbfff5 100644 --- a/Dataflow/README.md +++ b/Dataflow/README.md @@ -35,9 +35,8 @@ for more information about the debugging tools. ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Dataflow/owlbot.py b/Dataflow/owlbot.py index 4fdbf7349de4..0744d065707f 100644 --- a/Dataflow/owlbot.py +++ b/Dataflow/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,37 +32,14 @@ php.owlbot_main(src=src, dest=dest) -# Change the wording for the deprecation warning. +# remove class_alias code s.replace( - 'src/*/*_*.php', - r'will be removed in the next major release', - 'will be removed in a future release') - -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') # format generated clients subprocess.run([ @@ -72,8 +49,8 @@ '--package=@prettier/plugin-php@^0.16', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', - '--print-width=80']) + '--print-width=120']) diff --git a/Dataflow/src/V1beta3/AutoscalingEvent.php b/Dataflow/src/V1beta3/AutoscalingEvent.php index 7bdff352dc98..dce07d72546b 100644 --- a/Dataflow/src/V1beta3/AutoscalingEvent.php +++ b/Dataflow/src/V1beta3/AutoscalingEvent.php @@ -21,19 +21,19 @@ class AutoscalingEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 current_num_workers = 1; */ - private $current_num_workers = 0; + protected $current_num_workers = 0; /** * The target number of workers the worker pool wants to resize to use. * * Generated from protobuf field int64 target_num_workers = 2; */ - private $target_num_workers = 0; + protected $target_num_workers = 0; /** * The type of autoscaling event to report. * * Generated from protobuf field .google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3; */ - private $event_type = 0; + protected $event_type = 0; /** * A message describing why the system decided to adjust the current * number of workers, why it failed, or why the system decided to @@ -41,20 +41,20 @@ class AutoscalingEvent extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.StructuredMessage description = 4; */ - private $description = null; + protected $description = null; /** * The time this event was emitted to indicate a new target or current * num_workers value. * * Generated from protobuf field .google.protobuf.Timestamp time = 5; */ - private $time = null; + protected $time = null; /** * A short and friendly name for the worker pool this event refers to. * * Generated from protobuf field string worker_pool = 7; */ - private $worker_pool = ''; + protected $worker_pool = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/AutoscalingEvent/AutoscalingEventType.php b/Dataflow/src/V1beta3/AutoscalingEvent/AutoscalingEventType.php index 4a5aa81d5fbb..0dc51d3b79d0 100644 --- a/Dataflow/src/V1beta3/AutoscalingEvent/AutoscalingEventType.php +++ b/Dataflow/src/V1beta3/AutoscalingEvent/AutoscalingEventType.php @@ -83,6 +83,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AutoscalingEventType::class, \Google\Cloud\Dataflow\V1beta3\AutoscalingEvent_AutoscalingEventType::class); diff --git a/Dataflow/src/V1beta3/AutoscalingEvent_AutoscalingEventType.php b/Dataflow/src/V1beta3/AutoscalingEvent_AutoscalingEventType.php deleted file mode 100644 index dc0880b79f85..000000000000 --- a/Dataflow/src/V1beta3/AutoscalingEvent_AutoscalingEventType.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.dataflow.v1beta3.AutoscalingAlgorithm algorithm = 1; */ - private $algorithm = 0; + protected $algorithm = 0; /** * The maximum number of workers to cap scaling at. * * Generated from protobuf field int32 max_num_workers = 2; */ - private $max_num_workers = 0; + protected $max_num_workers = 0; /** * Constructor. diff --git a/Dataflow/src/V1beta3/BigQueryIODetails.php b/Dataflow/src/V1beta3/BigQueryIODetails.php index b16b2436e15e..bf20e64e8359 100644 --- a/Dataflow/src/V1beta3/BigQueryIODetails.php +++ b/Dataflow/src/V1beta3/BigQueryIODetails.php @@ -20,25 +20,25 @@ class BigQueryIODetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string table = 1; */ - private $table = ''; + protected $table = ''; /** * Dataset accessed in the connection. * * Generated from protobuf field string dataset = 2; */ - private $dataset = ''; + protected $dataset = ''; /** * Project accessed in the connection. * * Generated from protobuf field string project_id = 3; */ - private $project_id = ''; + protected $project_id = ''; /** * Query used to access data in the connection. * * Generated from protobuf field string query = 4; */ - private $query = ''; + protected $query = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/BigTableIODetails.php b/Dataflow/src/V1beta3/BigTableIODetails.php index 9e3a8c1d1480..78391624fb5c 100644 --- a/Dataflow/src/V1beta3/BigTableIODetails.php +++ b/Dataflow/src/V1beta3/BigTableIODetails.php @@ -20,19 +20,19 @@ class BigTableIODetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * InstanceId accessed in the connection. * * Generated from protobuf field string instance_id = 2; */ - private $instance_id = ''; + protected $instance_id = ''; /** * TableId accessed in the connection. * * Generated from protobuf field string table_id = 3; */ - private $table_id = ''; + protected $table_id = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/CheckActiveJobsRequest.php b/Dataflow/src/V1beta3/CheckActiveJobsRequest.php index 1da08755c744..07188cead57f 100644 --- a/Dataflow/src/V1beta3/CheckActiveJobsRequest.php +++ b/Dataflow/src/V1beta3/CheckActiveJobsRequest.php @@ -20,7 +20,7 @@ class CheckActiveJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/CheckActiveJobsResponse.php b/Dataflow/src/V1beta3/CheckActiveJobsResponse.php index 5ea63b8e2ca6..d2d94949d7d7 100644 --- a/Dataflow/src/V1beta3/CheckActiveJobsResponse.php +++ b/Dataflow/src/V1beta3/CheckActiveJobsResponse.php @@ -20,7 +20,7 @@ class CheckActiveJobsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool active_jobs_exist = 1; */ - private $active_jobs_exist = false; + protected $active_jobs_exist = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/Client/FlexTemplatesServiceClient.php b/Dataflow/src/V1beta3/Client/FlexTemplatesServiceClient.php index 4e1ca800f7a8..a1aa43df5df3 100644 --- a/Dataflow/src/V1beta3/Client/FlexTemplatesServiceClient.php +++ b/Dataflow/src/V1beta3/Client/FlexTemplatesServiceClient.php @@ -1,6 +1,6 @@ startApiCall('LaunchFlexTemplate', $request, $callOptions)->wait(); } } diff --git a/Dataflow/src/V1beta3/Client/JobsV1Beta3Client.php b/Dataflow/src/V1beta3/Client/JobsV1Beta3Client.php index 8b9e9d734f21..fc8292c50b69 100644 --- a/Dataflow/src/V1beta3/Client/JobsV1Beta3Client.php +++ b/Dataflow/src/V1beta3/Client/JobsV1Beta3Client.php @@ -1,6 +1,6 @@ startApiCall('GetJobExecutionDetails', $request, $callOptions); } @@ -272,8 +270,10 @@ public function getJobMetrics(GetJobMetricsRequest $request, array $callOptions * * @experimental */ - public function getStageExecutionDetails(GetStageExecutionDetailsRequest $request, array $callOptions = []): PagedListResponse - { + public function getStageExecutionDetails( + GetStageExecutionDetailsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('GetStageExecutionDetails', $request, $callOptions); } } diff --git a/Dataflow/src/V1beta3/Client/SnapshotsV1Beta3Client.php b/Dataflow/src/V1beta3/Client/SnapshotsV1Beta3Client.php index fa363774a12e..8f44153408dd 100644 --- a/Dataflow/src/V1beta3/Client/SnapshotsV1Beta3Client.php +++ b/Dataflow/src/V1beta3/Client/SnapshotsV1Beta3Client.php @@ -1,6 +1,6 @@ string system_stage_name = 1; */ - private $system_stage_name = ''; + protected $system_stage_name = ''; /** * The ID of the computation. * * Generated from protobuf field string computation_id = 5; */ - private $computation_id = ''; + protected $computation_id = ''; /** * The key ranges processed by the computation. * diff --git a/Dataflow/src/V1beta3/ContainerSpec.php b/Dataflow/src/V1beta3/ContainerSpec.php index 022ba042710e..54c9c6c1ca77 100644 --- a/Dataflow/src/V1beta3/ContainerSpec.php +++ b/Dataflow/src/V1beta3/ContainerSpec.php @@ -20,25 +20,25 @@ class ContainerSpec extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string image = 1; */ - private $image = ''; + protected $image = ''; /** * Metadata describing a template including description and validation rules. * * Generated from protobuf field .google.dataflow.v1beta3.TemplateMetadata metadata = 2; */ - private $metadata = null; + protected $metadata = null; /** * Required. SDK info of the Flex Template. * * Generated from protobuf field .google.dataflow.v1beta3.SDKInfo sdk_info = 3; */ - private $sdk_info = null; + protected $sdk_info = null; /** * Default runtime environment for the job. * * Generated from protobuf field .google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment default_environment = 4; */ - private $default_environment = null; + protected $default_environment = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/CreateJobFromTemplateRequest.php b/Dataflow/src/V1beta3/CreateJobFromTemplateRequest.php index ca10999f6106..c871ad251d03 100644 --- a/Dataflow/src/V1beta3/CreateJobFromTemplateRequest.php +++ b/Dataflow/src/V1beta3/CreateJobFromTemplateRequest.php @@ -20,13 +20,13 @@ class CreateJobFromTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * Required. The job name to use for the created job. * * Generated from protobuf field string job_name = 4; */ - private $job_name = ''; + protected $job_name = ''; /** * The runtime parameters to pass to the job. * @@ -38,7 +38,7 @@ class CreateJobFromTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.RuntimeEnvironment environment = 5; */ - private $environment = null; + protected $environment = null; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to @@ -46,7 +46,7 @@ class CreateJobFromTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 6; */ - private $location = ''; + protected $location = ''; protected $template; /** diff --git a/Dataflow/src/V1beta3/CreateJobRequest.php b/Dataflow/src/V1beta3/CreateJobRequest.php index ac52510c0d9f..32c308bf5729 100644 --- a/Dataflow/src/V1beta3/CreateJobRequest.php +++ b/Dataflow/src/V1beta3/CreateJobRequest.php @@ -20,25 +20,25 @@ class CreateJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job to create. * * Generated from protobuf field .google.dataflow.v1beta3.Job job = 2; */ - private $job = null; + protected $job = null; /** * The level of information requested in response. * * Generated from protobuf field .google.dataflow.v1beta3.JobView view = 3; */ - private $view = 0; + protected $view = 0; /** * Deprecated. This field is now in the Job message. * * Generated from protobuf field string replace_job_id = 4; */ - private $replace_job_id = ''; + protected $replace_job_id = ''; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -46,7 +46,7 @@ class CreateJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 5; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/CustomSourceLocation.php b/Dataflow/src/V1beta3/CustomSourceLocation.php index 298bad5917d2..7f631a775004 100644 --- a/Dataflow/src/V1beta3/CustomSourceLocation.php +++ b/Dataflow/src/V1beta3/CustomSourceLocation.php @@ -20,7 +20,7 @@ class CustomSourceLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool stateful = 1; */ - private $stateful = false; + protected $stateful = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/DataDiskAssignment.php b/Dataflow/src/V1beta3/DataDiskAssignment.php index 9f98da817beb..ac0fec435a17 100644 --- a/Dataflow/src/V1beta3/DataDiskAssignment.php +++ b/Dataflow/src/V1beta3/DataDiskAssignment.php @@ -21,7 +21,7 @@ class DataDiskAssignment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string vm_instance = 1; */ - private $vm_instance = ''; + protected $vm_instance = ''; /** * Mounted data disks. The order is important a data disk's 0-based index in * this list defines which persistent directory the disk is mounted to, for diff --git a/Dataflow/src/V1beta3/DatastoreIODetails.php b/Dataflow/src/V1beta3/DatastoreIODetails.php index d9e5f588f3a4..028783f08fd7 100644 --- a/Dataflow/src/V1beta3/DatastoreIODetails.php +++ b/Dataflow/src/V1beta3/DatastoreIODetails.php @@ -20,13 +20,13 @@ class DatastoreIODetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string namespace = 1; */ - private $namespace = ''; + protected $namespace = ''; /** * ProjectId accessed in the connection. * * Generated from protobuf field string project_id = 2; */ - private $project_id = ''; + protected $project_id = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/DebugOptions.php b/Dataflow/src/V1beta3/DebugOptions.php index a3157e75ffc1..d907266c4e09 100644 --- a/Dataflow/src/V1beta3/DebugOptions.php +++ b/Dataflow/src/V1beta3/DebugOptions.php @@ -21,7 +21,7 @@ class DebugOptions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool enable_hot_key_logging = 1; */ - private $enable_hot_key_logging = false; + protected $enable_hot_key_logging = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/DeleteSnapshotRequest.php b/Dataflow/src/V1beta3/DeleteSnapshotRequest.php index 8c0db577637e..5e3c13c4f757 100644 --- a/Dataflow/src/V1beta3/DeleteSnapshotRequest.php +++ b/Dataflow/src/V1beta3/DeleteSnapshotRequest.php @@ -20,19 +20,19 @@ class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The ID of the snapshot. * * Generated from protobuf field string snapshot_id = 2; */ - private $snapshot_id = ''; + protected $snapshot_id = ''; /** * The location that contains this snapshot. * * Generated from protobuf field string location = 3; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/Disk.php b/Dataflow/src/V1beta3/Disk.php index 62240c62e01a..5cce44bd8a71 100644 --- a/Dataflow/src/V1beta3/Disk.php +++ b/Dataflow/src/V1beta3/Disk.php @@ -21,7 +21,7 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 size_gb = 1; */ - private $size_gb = 0; + protected $size_gb = 0; /** * Disk storage type, as defined by Google Compute Engine. This * must be a disk type appropriate to the project and zone in which @@ -41,13 +41,13 @@ class Disk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string disk_type = 2; */ - private $disk_type = ''; + protected $disk_type = ''; /** * Directory in a VM where disk is mounted. * * Generated from protobuf field string mount_point = 3; */ - private $mount_point = ''; + protected $mount_point = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/DisplayData.php b/Dataflow/src/V1beta3/DisplayData.php index 36922ac6f998..72581fb44af6 100644 --- a/Dataflow/src/V1beta3/DisplayData.php +++ b/Dataflow/src/V1beta3/DisplayData.php @@ -22,7 +22,7 @@ class DisplayData extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * The namespace for the key. This is usually a class name or programming * language namespace (i.e. python module) which defines the display data. @@ -31,7 +31,7 @@ class DisplayData extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string namespace = 2; */ - private $namespace = ''; + protected $namespace = ''; /** * A possible additional shorter value to display. * For example a java_class_name_value of com.mypackage.MyDoFn @@ -42,19 +42,19 @@ class DisplayData extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string short_str_value = 11; */ - private $short_str_value = ''; + protected $short_str_value = ''; /** * An optional full URL. * * Generated from protobuf field string url = 12; */ - private $url = ''; + protected $url = ''; /** * An optional label to display in a dax UI for the element. * * Generated from protobuf field string label = 13; */ - private $label = ''; + protected $label = ''; protected $Value; /** diff --git a/Dataflow/src/V1beta3/DynamicTemplateLaunchParams.php b/Dataflow/src/V1beta3/DynamicTemplateLaunchParams.php index 9089690e77c4..7f2bb85432ed 100644 --- a/Dataflow/src/V1beta3/DynamicTemplateLaunchParams.php +++ b/Dataflow/src/V1beta3/DynamicTemplateLaunchParams.php @@ -21,14 +21,14 @@ class DynamicTemplateLaunchParams extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string gcs_path = 1; */ - private $gcs_path = ''; + protected $gcs_path = ''; /** * Cloud Storage path for staging dependencies. * Must be a valid Cloud Storage URL, beginning with `gs://`. * * Generated from protobuf field string staging_location = 2; */ - private $staging_location = ''; + protected $staging_location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/Environment.php b/Dataflow/src/V1beta3/Environment.php index 5ba4d2d76448..0bbfff76e254 100644 --- a/Dataflow/src/V1beta3/Environment.php +++ b/Dataflow/src/V1beta3/Environment.php @@ -30,7 +30,7 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string temp_storage_prefix = 1; */ - private $temp_storage_prefix = ''; + protected $temp_storage_prefix = ''; /** * The type of cluster manager API to use. If unknown or * unspecified, the service will attempt to choose a reasonable @@ -39,7 +39,7 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string cluster_manager_api_service = 2; */ - private $cluster_manager_api_service = ''; + protected $cluster_manager_api_service = ''; /** * The list of experiments to enable. This field should be used for SDK * related experiments and not for service related experiments. The proper @@ -64,7 +64,7 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_kms_key_name = 12; */ - private $service_kms_key_name = ''; + protected $service_kms_key_name = ''; /** * The worker pools. At least one "harness" worker pool must be * specified in order for the job to have workers. @@ -77,14 +77,14 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct user_agent = 5; */ - private $user_agent = null; + protected $user_agent = null; /** * A structure describing which components and their versions of the service * are required in order to run the job. * * Generated from protobuf field .google.protobuf.Struct version = 6; */ - private $version = null; + protected $version = null; /** * The dataset for the current project where various workflow * related tables are stored. @@ -94,7 +94,7 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string dataset = 7; */ - private $dataset = ''; + protected $dataset = ''; /** * The Cloud Dataflow SDK pipeline options specified by the user. These * options are passed through the service and are used to recreate the @@ -103,25 +103,25 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct sdk_pipeline_options = 8; */ - private $sdk_pipeline_options = null; + protected $sdk_pipeline_options = null; /** * Experimental settings. * * Generated from protobuf field .google.protobuf.Any internal_experiments = 9; */ - private $internal_experiments = null; + protected $internal_experiments = null; /** * Identity to run virtual machines as. Defaults to the default account. * * Generated from protobuf field string service_account_email = 10; */ - private $service_account_email = ''; + protected $service_account_email = ''; /** * Which Flexible Resource Scheduling mode to run in. * * Generated from protobuf field .google.dataflow.v1beta3.FlexResourceSchedulingGoal flex_resource_scheduling_goal = 11; */ - private $flex_resource_scheduling_goal = 0; + protected $flex_resource_scheduling_goal = 0; /** * The Compute Engine region * (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in @@ -131,7 +131,7 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_region = 13; */ - private $worker_region = ''; + protected $worker_region = ''; /** * The Compute Engine zone * (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in @@ -141,19 +141,19 @@ class Environment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_zone = 14; */ - private $worker_zone = ''; + protected $worker_zone = ''; /** * Output only. The shuffle mode used for the job. * * Generated from protobuf field .google.dataflow.v1beta3.ShuffleMode shuffle_mode = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $shuffle_mode = 0; + protected $shuffle_mode = 0; /** * Any debugging options to be supplied to the job. * * Generated from protobuf field .google.dataflow.v1beta3.DebugOptions debug_options = 17; */ - private $debug_options = null; + protected $debug_options = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/ExecutionStageState.php b/Dataflow/src/V1beta3/ExecutionStageState.php index 73ec69189329..dec58dbf78af 100644 --- a/Dataflow/src/V1beta3/ExecutionStageState.php +++ b/Dataflow/src/V1beta3/ExecutionStageState.php @@ -20,19 +20,19 @@ class ExecutionStageState extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string execution_stage_name = 1; */ - private $execution_stage_name = ''; + protected $execution_stage_name = ''; /** * Executions stage states allow the same set of values as JobState. * * Generated from protobuf field .google.dataflow.v1beta3.JobState execution_stage_state = 2; */ - private $execution_stage_state = 0; + protected $execution_stage_state = 0; /** * The time at which the stage transitioned to this state. * * Generated from protobuf field .google.protobuf.Timestamp current_state_time = 3; */ - private $current_state_time = null; + protected $current_state_time = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/ExecutionStageSummary.php b/Dataflow/src/V1beta3/ExecutionStageSummary.php index b3656815b324..645532bc5f1f 100644 --- a/Dataflow/src/V1beta3/ExecutionStageSummary.php +++ b/Dataflow/src/V1beta3/ExecutionStageSummary.php @@ -22,19 +22,19 @@ class ExecutionStageSummary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Dataflow service generated id for this stage. * * Generated from protobuf field string id = 2; */ - private $id = ''; + protected $id = ''; /** * Type of transform this stage is executing. * * Generated from protobuf field .google.dataflow.v1beta3.KindType kind = 3; */ - private $kind = 0; + protected $kind = 0; /** * Input sources for this stage. * diff --git a/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentSource.php b/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentSource.php index 71a17d6fea4c..96551efedbcc 100644 --- a/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentSource.php +++ b/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentSource.php @@ -21,20 +21,20 @@ class ComponentSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string user_name = 1; */ - private $user_name = ''; + protected $user_name = ''; /** * Dataflow service generated name for this source. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * User name for the original user transform or collection with which this * source is most closely associated. * * Generated from protobuf field string original_transform_or_collection = 3; */ - private $original_transform_or_collection = ''; + protected $original_transform_or_collection = ''; /** * Constructor. @@ -138,6 +138,4 @@ public function setOriginalTransformOrCollection($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ComponentSource::class, \Google\Cloud\Dataflow\V1beta3\ExecutionStageSummary_ComponentSource::class); diff --git a/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentTransform.php b/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentTransform.php index 0debe0997819..a2ab4ba72cfc 100644 --- a/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentTransform.php +++ b/Dataflow/src/V1beta3/ExecutionStageSummary/ComponentTransform.php @@ -20,20 +20,20 @@ class ComponentTransform extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string user_name = 1; */ - private $user_name = ''; + protected $user_name = ''; /** * Dataflow service generated name for this source. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * User name for the original user transform with which this transform is * most closely associated. * * Generated from protobuf field string original_transform = 3; */ - private $original_transform = ''; + protected $original_transform = ''; /** * Constructor. @@ -137,6 +137,4 @@ public function setOriginalTransform($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ComponentTransform::class, \Google\Cloud\Dataflow\V1beta3\ExecutionStageSummary_ComponentTransform::class); diff --git a/Dataflow/src/V1beta3/ExecutionStageSummary/StageSource.php b/Dataflow/src/V1beta3/ExecutionStageSummary/StageSource.php index 1ddc36911be9..ab49f658558e 100644 --- a/Dataflow/src/V1beta3/ExecutionStageSummary/StageSource.php +++ b/Dataflow/src/V1beta3/ExecutionStageSummary/StageSource.php @@ -20,26 +20,26 @@ class StageSource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string user_name = 1; */ - private $user_name = ''; + protected $user_name = ''; /** * Dataflow service generated name for this source. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * User name for the original user transform or collection with which this * source is most closely associated. * * Generated from protobuf field string original_transform_or_collection = 3; */ - private $original_transform_or_collection = ''; + protected $original_transform_or_collection = ''; /** * Size of the source, if measurable. * * Generated from protobuf field int64 size_bytes = 4; */ - private $size_bytes = 0; + protected $size_bytes = 0; /** * Constructor. @@ -171,6 +171,4 @@ public function setSizeBytes($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(StageSource::class, \Google\Cloud\Dataflow\V1beta3\ExecutionStageSummary_StageSource::class); diff --git a/Dataflow/src/V1beta3/ExecutionStageSummary_ComponentSource.php b/Dataflow/src/V1beta3/ExecutionStageSummary_ComponentSource.php deleted file mode 100644 index 7c6308d29999..000000000000 --- a/Dataflow/src/V1beta3/ExecutionStageSummary_ComponentSource.php +++ /dev/null @@ -1,16 +0,0 @@ -string name = 1; */ - private $name = ''; + protected $name = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/FileIODetails.php b/Dataflow/src/V1beta3/FileIODetails.php index d10612140343..266d99a1dce6 100644 --- a/Dataflow/src/V1beta3/FileIODetails.php +++ b/Dataflow/src/V1beta3/FileIODetails.php @@ -20,7 +20,7 @@ class FileIODetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string file_pattern = 1; */ - private $file_pattern = ''; + protected $file_pattern = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/FlexTemplateRuntimeEnvironment.php b/Dataflow/src/V1beta3/FlexTemplateRuntimeEnvironment.php index 75b0d054e48f..04c8d52ea43f 100644 --- a/Dataflow/src/V1beta3/FlexTemplateRuntimeEnvironment.php +++ b/Dataflow/src/V1beta3/FlexTemplateRuntimeEnvironment.php @@ -20,14 +20,14 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 num_workers = 1; */ - private $num_workers = 0; + protected $num_workers = 0; /** * The maximum number of Google Compute Engine instances to be made * available to your pipeline during execution, from 1 to 1000. * * Generated from protobuf field int32 max_workers = 2; */ - private $max_workers = 0; + protected $max_workers = 0; /** * The Compute Engine [availability * zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) @@ -36,27 +36,27 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string zone = 3; */ - private $zone = ''; + protected $zone = ''; /** * The email address of the service account to run the job as. * * Generated from protobuf field string service_account_email = 4; */ - private $service_account_email = ''; + protected $service_account_email = ''; /** * The Cloud Storage path to use for temporary files. * Must be a valid Cloud Storage URL, beginning with `gs://`. * * Generated from protobuf field string temp_location = 5; */ - private $temp_location = ''; + protected $temp_location = ''; /** * The machine type to use for the job. Defaults to the value from the * template if not specified. * * Generated from protobuf field string machine_type = 6; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Additional experiment flags for the job. * @@ -69,7 +69,7 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 8; */ - private $network = ''; + protected $network = ''; /** * Subnetwork to which VMs will be assigned, if desired. You can specify a * subnetwork using either a complete URL or an abbreviated path. Expected to @@ -80,7 +80,7 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string subnetwork = 9; */ - private $subnetwork = ''; + protected $subnetwork = ''; /** * Additional user labels to be specified for the job. * Keys and values must follow the restrictions specified in the [labeling @@ -99,13 +99,13 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key_name = 11; */ - private $kms_key_name = ''; + protected $kms_key_name = ''; /** * Configuration for VM IPs. * * Generated from protobuf field .google.dataflow.v1beta3.WorkerIPAddressConfiguration ip_configuration = 12; */ - private $ip_configuration = 0; + protected $ip_configuration = 0; /** * The Compute Engine region * (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in @@ -115,7 +115,7 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_region = 13; */ - private $worker_region = ''; + protected $worker_region = ''; /** * The Compute Engine zone * (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in @@ -126,27 +126,27 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_zone = 14; */ - private $worker_zone = ''; + protected $worker_zone = ''; /** * Whether to enable Streaming Engine for the job. * * Generated from protobuf field bool enable_streaming_engine = 15; */ - private $enable_streaming_engine = false; + protected $enable_streaming_engine = false; /** * Set FlexRS goal for the job. * https://cloud.google.com/dataflow/docs/guides/flexrs * * Generated from protobuf field .google.dataflow.v1beta3.FlexResourceSchedulingGoal flexrs_goal = 16; */ - private $flexrs_goal = 0; + protected $flexrs_goal = 0; /** * The Cloud Storage path for staging local files. * Must be a valid Cloud Storage URL, beginning with `gs://`. * * Generated from protobuf field string staging_location = 17; */ - private $staging_location = ''; + protected $staging_location = ''; /** * Docker registry location of container image to use for the 'worker harness. * Default is the container for the version of the SDK. Note this field is @@ -154,19 +154,19 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string sdk_container_image = 18; */ - private $sdk_container_image = ''; + protected $sdk_container_image = ''; /** * Worker disk size, in gigabytes. * * Generated from protobuf field int32 disk_size_gb = 20; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * The algorithm to use for autoscaling * * Generated from protobuf field .google.dataflow.v1beta3.AutoscalingAlgorithm autoscaling_algorithm = 21; */ - private $autoscaling_algorithm = 0; + protected $autoscaling_algorithm = 0; /** * If true, save a heap dump before killing a thread or process which is GC * thrashing or out of memory. The location of the heap file will either be @@ -175,7 +175,7 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool dump_heap_on_oom = 22; */ - private $dump_heap_on_oom = false; + protected $dump_heap_on_oom = false; /** * Cloud Storage bucket (directory) to upload heap dumps to the given * location. Enabling this implies that heap dumps should be generated on OOM @@ -183,14 +183,14 @@ class FlexTemplateRuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string save_heap_dumps_to_gcs_path = 23; */ - private $save_heap_dumps_to_gcs_path = ''; + protected $save_heap_dumps_to_gcs_path = ''; /** * The machine type to use for launching the job. The default is * n1-standard-1. * * Generated from protobuf field string launcher_machine_type = 24; */ - private $launcher_machine_type = ''; + protected $launcher_machine_type = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/FlexTemplatesServiceClient.php b/Dataflow/src/V1beta3/FlexTemplatesServiceClient.php deleted file mode 100644 index 8603ed6978f6..000000000000 --- a/Dataflow/src/V1beta3/FlexTemplatesServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.dataflow.v1beta3.FlexTemplatesService/LaunchFlexTemplate', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\LaunchFlexTemplateResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataflow/src/V1beta3/Gapic/FlexTemplatesServiceGapicClient.php b/Dataflow/src/V1beta3/Gapic/FlexTemplatesServiceGapicClient.php deleted file mode 100644 index d9ad903049f7..000000000000 --- a/Dataflow/src/V1beta3/Gapic/FlexTemplatesServiceGapicClient.php +++ /dev/null @@ -1,255 +0,0 @@ -launchFlexTemplate(); - * } finally { - * $flexTemplatesServiceClient->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataflow\V1beta3\Client\FlexTemplatesServiceClient}. - */ -class FlexTemplatesServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.dataflow.v1beta3.FlexTemplatesService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/compute.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . - '/../resources/flex_templates_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/flex_templates_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . - '/../resources/flex_templates_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/flex_templates_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataflow.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Launch a job with a FlexTemplate. - * - * Sample code: - * ``` - * $flexTemplatesServiceClient = new FlexTemplatesServiceClient(); - * try { - * $response = $flexTemplatesServiceClient->launchFlexTemplate(); - * } finally { - * $flexTemplatesServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Required. The ID of the Cloud Platform project that the job belongs to. - * @type LaunchFlexTemplateParameter $launchParameter - * Required. Parameter to launch a job form Flex Template. - * @type string $location - * Required. The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to - * which to direct the request. E.g., us-central1, us-west1. - * @type bool $validateOnly - * If true, the request is validated but not actually executed. - * Defaults to false. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\LaunchFlexTemplateResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function launchFlexTemplate(array $optionalArgs = []) - { - $request = new LaunchFlexTemplateRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['launchParameter'])) { - $request->setLaunchParameter($optionalArgs['launchParameter']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'LaunchFlexTemplate', - LaunchFlexTemplateResponse::class, - $optionalArgs, - $request - )->wait(); - } -} diff --git a/Dataflow/src/V1beta3/Gapic/JobsV1Beta3GapicClient.php b/Dataflow/src/V1beta3/Gapic/JobsV1Beta3GapicClient.php deleted file mode 100644 index 0d534b6d0677..000000000000 --- a/Dataflow/src/V1beta3/Gapic/JobsV1Beta3GapicClient.php +++ /dev/null @@ -1,798 +0,0 @@ -aggregatedListJobs(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobsV1Beta3Client->aggregatedListJobs(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataflow\V1beta3\Client\JobsV1Beta3Client}. - */ -class JobsV1Beta3GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.dataflow.v1beta3.JobsV1Beta3'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/compute.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/jobs_v1_beta3_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . '/../resources/jobs_v1_beta3_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/jobs_v1_beta3_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/jobs_v1_beta3_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataflow.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * List the jobs of a project across all regions. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $jobsV1Beta3Client->aggregatedListJobs(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobsV1Beta3Client->aggregatedListJobs(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $filter - * The kind of filter to use. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\ListJobsRequest\Filter} - * @type string $projectId - * The project which owns the jobs. - * @type int $view - * Deprecated. ListJobs always returns summaries now. - * Use GetJob for other JobViews. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\JobView} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains this job. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function aggregatedListJobs(array $optionalArgs = []) - { - $request = new ListJobsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'AggregatedListJobs', - $optionalArgs, - ListJobsResponse::class, - $request - ); - } - - /** - * Check for existence of active jobs in the given project across all regions. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * $response = $jobsV1Beta3Client->checkActiveJobs(); - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The project which owns the jobs. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\CheckActiveJobsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function checkActiveJobs(array $optionalArgs = []) - { - $request = new CheckActiveJobsRequest(); - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - } - - return $this->startCall( - 'CheckActiveJobs', - CheckActiveJobsResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Creates a Cloud Dataflow job. - * - * To create a job, we recommend using `projects.locations.jobs.create` with a - * [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.create` is not recommended, as your job will always start - * in `us-central1`. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * $response = $jobsV1Beta3Client->createJob(); - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The ID of the Cloud Platform project that the job belongs to. - * @type Job $job - * The job to create. - * @type int $view - * The level of information requested in response. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\JobView} - * @type string $replaceJobId - * Deprecated. This field is now in the Job message. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains this job. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\Job - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createJob(array $optionalArgs = []) - { - $request = new CreateJobRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['job'])) { - $request->setJob($optionalArgs['job']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['replaceJobId'])) { - $request->setReplaceJobId($optionalArgs['replaceJobId']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateJob', - Job::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets the state of the specified Cloud Dataflow job. - * - * To get the state of a job, we recommend using `projects.locations.jobs.get` - * with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.get` is not recommended, as you can only get the state of - * jobs that are running in `us-central1`. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * $response = $jobsV1Beta3Client->getJob(); - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The ID of the Cloud Platform project that the job belongs to. - * @type string $jobId - * The job ID. - * @type int $view - * The level of information requested in response. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\JobView} - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains this job. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\Job - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getJob(array $optionalArgs = []) - { - $request = new GetJobRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetJob', - Job::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * List the jobs of a project. - * - * To list the jobs of a project in a region, we recommend using - * `projects.locations.jobs.list` with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To - * list the all jobs across all regions, use `projects.jobs.aggregated`. Using - * `projects.jobs.list` is not recommended, as you can only get the list of - * jobs that are running in `us-central1`. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $jobsV1Beta3Client->listJobs(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $jobsV1Beta3Client->listJobs(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $filter - * The kind of filter to use. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\ListJobsRequest\Filter} - * @type string $projectId - * The project which owns the jobs. - * @type int $view - * Deprecated. ListJobs always returns summaries now. - * Use GetJob for other JobViews. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\JobView} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains this job. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listJobs(array $optionalArgs = []) - { - $request = new ListJobsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListJobs', - $optionalArgs, - ListJobsResponse::class, - $request - ); - } - - /** - * Snapshot the state of a streaming job. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * $response = $jobsV1Beta3Client->snapshotJob(); - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The project which owns the job to be snapshotted. - * @type string $jobId - * The job to be snapshotted. - * @type Duration $ttl - * TTL for the snapshot. - * @type string $location - * The location that contains this job. - * @type bool $snapshotSources - * If true, perform snapshots for sources which support this. - * @type string $description - * User specified description of the snapshot. Maybe empty. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\Snapshot - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function snapshotJob(array $optionalArgs = []) - { - $request = new SnapshotJobRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['ttl'])) { - $request->setTtl($optionalArgs['ttl']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - if (isset($optionalArgs['snapshotSources'])) { - $request->setSnapshotSources($optionalArgs['snapshotSources']); - } - - if (isset($optionalArgs['description'])) { - $request->setDescription($optionalArgs['description']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SnapshotJob', - Snapshot::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Updates the state of an existing Cloud Dataflow job. - * - * To update the state of an existing job, we recommend using - * `projects.locations.jobs.update` with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.update` is not recommended, as you can only update the state - * of jobs that are running in `us-central1`. - * - * Sample code: - * ``` - * $jobsV1Beta3Client = new JobsV1Beta3Client(); - * try { - * $response = $jobsV1Beta3Client->updateJob(); - * } finally { - * $jobsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The ID of the Cloud Platform project that the job belongs to. - * @type string $jobId - * The job ID. - * @type Job $job - * The updated job. - * Only the job state is updatable; other fields will be ignored. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains this job. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\Job - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateJob(array $optionalArgs = []) - { - $request = new UpdateJobRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['job'])) { - $request->setJob($optionalArgs['job']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'UpdateJob', - Job::class, - $optionalArgs, - $request - )->wait(); - } -} diff --git a/Dataflow/src/V1beta3/Gapic/MessagesV1Beta3GapicClient.php b/Dataflow/src/V1beta3/Gapic/MessagesV1Beta3GapicClient.php deleted file mode 100644 index 0b2db270c3f3..000000000000 --- a/Dataflow/src/V1beta3/Gapic/MessagesV1Beta3GapicClient.php +++ /dev/null @@ -1,316 +0,0 @@ -listJobMessages(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $messagesV1Beta3Client->listJobMessages(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $messagesV1Beta3Client->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataflow\V1beta3\Client\MessagesV1Beta3Client}. - */ -class MessagesV1Beta3GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.dataflow.v1beta3.MessagesV1Beta3'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/compute.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/messages_v1_beta3_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/messages_v1_beta3_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/messages_v1_beta3_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/messages_v1_beta3_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataflow.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Request the job status. - * - * To request the status of a job, we recommend using - * `projects.locations.jobs.messages.list` with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.messages.list` is not recommended, as you can only request - * the status of jobs that are running in `us-central1`. - * - * Sample code: - * ``` - * $messagesV1Beta3Client = new MessagesV1Beta3Client(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $messagesV1Beta3Client->listJobMessages(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $messagesV1Beta3Client->listJobMessages(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $messagesV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * A project id. - * @type string $jobId - * The job to get messages about. - * @type int $minimumImportance - * Filter to only get messages with importance >= level - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\JobMessageImportance} - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type Timestamp $startTime - * If specified, return only messages with timestamps >= start_time. - * The default is the job creation time (i.e. beginning of messages). - * @type Timestamp $endTime - * Return only messages with timestamps < end_time. The default is now - * (i.e. return up to the latest messages available). - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains the job specified by job_id. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listJobMessages(array $optionalArgs = []) - { - $request = new ListJobMessagesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['minimumImportance'])) { - $request->setMinimumImportance($optionalArgs['minimumImportance']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - if (isset($optionalArgs['endTime'])) { - $request->setEndTime($optionalArgs['endTime']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'ListJobMessages', - $optionalArgs, - ListJobMessagesResponse::class, - $request - ); - } -} diff --git a/Dataflow/src/V1beta3/Gapic/MetricsV1Beta3GapicClient.php b/Dataflow/src/V1beta3/Gapic/MetricsV1Beta3GapicClient.php deleted file mode 100644 index 34d254559dba..000000000000 --- a/Dataflow/src/V1beta3/Gapic/MetricsV1Beta3GapicClient.php +++ /dev/null @@ -1,497 +0,0 @@ -getJobExecutionDetails(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricsV1Beta3Client->getJobExecutionDetails(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricsV1Beta3Client->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataflow\V1beta3\Client\MetricsV1Beta3Client}. - */ -class MetricsV1Beta3GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.dataflow.v1beta3.MetricsV1Beta3'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/compute.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/metrics_v1_beta3_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/metrics_v1_beta3_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/metrics_v1_beta3_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/metrics_v1_beta3_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataflow.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Request detailed information about the execution status of the job. - * - * EXPERIMENTAL. This API is subject to change or removal without notice. - * - * Sample code: - * ``` - * $metricsV1Beta3Client = new MetricsV1Beta3Client(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $metricsV1Beta3Client->getJobExecutionDetails(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricsV1Beta3Client->getJobExecutionDetails(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * A project id. - * @type string $jobId - * The job to get execution details for. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains the job specified by job_id. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getJobExecutionDetails(array $optionalArgs = []) - { - $request = new GetJobExecutionDetailsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'GetJobExecutionDetails', - $optionalArgs, - JobExecutionDetails::class, - $request - ); - } - - /** - * Request the job status. - * - * To request the status of a job, we recommend using - * `projects.locations.jobs.getMetrics` with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.getMetrics` is not recommended, as you can only request the - * status of jobs that are running in `us-central1`. - * - * Sample code: - * ``` - * $metricsV1Beta3Client = new MetricsV1Beta3Client(); - * try { - * $response = $metricsV1Beta3Client->getJobMetrics(); - * } finally { - * $metricsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * A project id. - * @type string $jobId - * The job to get metrics for. - * @type Timestamp $startTime - * Return only metric data that has changed since this time. - * Default is to return all information about all metrics for the job. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains the job specified by job_id. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\JobMetrics - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getJobMetrics(array $optionalArgs = []) - { - $request = new GetJobMetricsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetJobMetrics', - JobMetrics::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Request detailed information about the execution status of a stage of the - * job. - * - * EXPERIMENTAL. This API is subject to change or removal without notice. - * - * Sample code: - * ``` - * $metricsV1Beta3Client = new MetricsV1Beta3Client(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $metricsV1Beta3Client->getStageExecutionDetails(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $metricsV1Beta3Client->getStageExecutionDetails(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $metricsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * A project id. - * @type string $jobId - * The job to get execution details for. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that - * contains the job specified by job_id. - * @type string $stageId - * The stage for which to fetch information. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type Timestamp $startTime - * Lower time bound of work items to include, by start time. - * @type Timestamp $endTime - * Upper time bound of work items to include, by start time. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getStageExecutionDetails(array $optionalArgs = []) - { - $request = new GetStageExecutionDetailsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - if (isset($optionalArgs['stageId'])) { - $request->setStageId($optionalArgs['stageId']); - $requestParamHeaders['stage_id'] = $optionalArgs['stageId']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['startTime'])) { - $request->setStartTime($optionalArgs['startTime']); - } - - if (isset($optionalArgs['endTime'])) { - $request->setEndTime($optionalArgs['endTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->getPagedListResponse( - 'GetStageExecutionDetails', - $optionalArgs, - StageExecutionDetails::class, - $request - ); - } -} diff --git a/Dataflow/src/V1beta3/Gapic/SnapshotsV1Beta3GapicClient.php b/Dataflow/src/V1beta3/Gapic/SnapshotsV1Beta3GapicClient.php deleted file mode 100644 index d9ac37c5d44b..000000000000 --- a/Dataflow/src/V1beta3/Gapic/SnapshotsV1Beta3GapicClient.php +++ /dev/null @@ -1,382 +0,0 @@ -deleteSnapshot(); - * } finally { - * $snapshotsV1Beta3Client->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataflow\V1beta3\Client\SnapshotsV1Beta3Client}. - */ -class SnapshotsV1Beta3GapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.dataflow.v1beta3.SnapshotsV1Beta3'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/compute.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/snapshots_v1_beta3_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/snapshots_v1_beta3_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/snapshots_v1_beta3_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/snapshots_v1_beta3_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataflow.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Deletes a snapshot. - * - * Sample code: - * ``` - * $snapshotsV1Beta3Client = new SnapshotsV1Beta3Client(); - * try { - * $response = $snapshotsV1Beta3Client->deleteSnapshot(); - * } finally { - * $snapshotsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The ID of the Cloud Platform project that the snapshot belongs to. - * @type string $snapshotId - * The ID of the snapshot. - * @type string $location - * The location that contains this snapshot. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\DeleteSnapshotResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteSnapshot(array $optionalArgs = []) - { - $request = new DeleteSnapshotRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['snapshotId'])) { - $request->setSnapshotId($optionalArgs['snapshotId']); - $requestParamHeaders['snapshot_id'] = $optionalArgs['snapshotId']; - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'DeleteSnapshot', - DeleteSnapshotResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Gets information about a snapshot. - * - * Sample code: - * ``` - * $snapshotsV1Beta3Client = new SnapshotsV1Beta3Client(); - * try { - * $response = $snapshotsV1Beta3Client->getSnapshot(); - * } finally { - * $snapshotsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The ID of the Cloud Platform project that the snapshot belongs to. - * @type string $snapshotId - * The ID of the snapshot. - * @type string $location - * The location that contains this snapshot. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\Snapshot - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getSnapshot(array $optionalArgs = []) - { - $request = new GetSnapshotRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['snapshotId'])) { - $request->setSnapshotId($optionalArgs['snapshotId']); - $requestParamHeaders['snapshot_id'] = $optionalArgs['snapshotId']; - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetSnapshot', - Snapshot::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Lists snapshots. - * - * Sample code: - * ``` - * $snapshotsV1Beta3Client = new SnapshotsV1Beta3Client(); - * try { - * $response = $snapshotsV1Beta3Client->listSnapshots(); - * } finally { - * $snapshotsV1Beta3Client->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * The project ID to list snapshots for. - * @type string $jobId - * If specified, list snapshots created from this job. - * @type string $location - * The location to list snapshots in. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\ListSnapshotsResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listSnapshots(array $optionalArgs = []) - { - $request = new ListSnapshotsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - $requestParamHeaders['job_id'] = $optionalArgs['jobId']; - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'ListSnapshots', - ListSnapshotsResponse::class, - $optionalArgs, - $request - )->wait(); - } -} diff --git a/Dataflow/src/V1beta3/Gapic/TemplatesServiceGapicClient.php b/Dataflow/src/V1beta3/Gapic/TemplatesServiceGapicClient.php deleted file mode 100644 index fc6396ee045c..000000000000 --- a/Dataflow/src/V1beta3/Gapic/TemplatesServiceGapicClient.php +++ /dev/null @@ -1,439 +0,0 @@ -createJobFromTemplate(); - * } finally { - * $templatesServiceClient->close(); - * } - * ``` - * - * @experimental - * - * @deprecated Please use the new service client {@see \Google\Cloud\Dataflow\V1beta3\Client\TemplatesServiceClient}. - */ -class TemplatesServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.dataflow.v1beta3.TemplatesService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'dataflow.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'dataflow.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/compute', - 'https://www.googleapis.com/auth/compute.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => - self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => - __DIR__ . '/../resources/templates_service_client_config.json', - 'descriptorsConfigPath' => - __DIR__ . - '/../resources/templates_service_descriptor_config.php', - 'gcpApiConfigPath' => - __DIR__ . '/../resources/templates_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => - __DIR__ . - '/../resources/templates_service_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'dataflow.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a Cloud Dataflow job from a template. - * - * Sample code: - * ``` - * $templatesServiceClient = new TemplatesServiceClient(); - * try { - * $response = $templatesServiceClient->createJobFromTemplate(); - * } finally { - * $templatesServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Required. The ID of the Cloud Platform project that the job belongs to. - * @type string $jobName - * Required. The job name to use for the created job. - * @type string $gcsPath - * Required. A Cloud Storage path to the template from which to - * create the job. - * Must be a valid Cloud Storage URL, beginning with `gs://`. - * @type array $parameters - * The runtime parameters to pass to the job. - * @type RuntimeEnvironment $environment - * The runtime environment for the job. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to - * which to direct the request. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\Job - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createJobFromTemplate(array $optionalArgs = []) - { - $request = new CreateJobFromTemplateRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['jobName'])) { - $request->setJobName($optionalArgs['jobName']); - } - - if (isset($optionalArgs['gcsPath'])) { - $request->setGcsPath($optionalArgs['gcsPath']); - } - - if (isset($optionalArgs['parameters'])) { - $request->setParameters($optionalArgs['parameters']); - } - - if (isset($optionalArgs['environment'])) { - $request->setEnvironment($optionalArgs['environment']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'CreateJobFromTemplate', - Job::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Get the template associated with a template. - * - * Sample code: - * ``` - * $templatesServiceClient = new TemplatesServiceClient(); - * try { - * $response = $templatesServiceClient->getTemplate(); - * } finally { - * $templatesServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Required. The ID of the Cloud Platform project that the job belongs to. - * @type string $gcsPath - * Required. A Cloud Storage path to the template from which to - * create the job. - * Must be valid Cloud Storage URL, beginning with 'gs://'. - * @type int $view - * The view to retrieve. Defaults to METADATA_ONLY. - * For allowed values, use constants defined on {@see \Google\Cloud\Dataflow\V1beta3\GetTemplateRequest\TemplateView} - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to - * which to direct the request. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\GetTemplateResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getTemplate(array $optionalArgs = []) - { - $request = new GetTemplateRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['gcsPath'])) { - $request->setGcsPath($optionalArgs['gcsPath']); - } - - if (isset($optionalArgs['view'])) { - $request->setView($optionalArgs['view']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetTemplate', - GetTemplateResponse::class, - $optionalArgs, - $request - )->wait(); - } - - /** - * Launch a template. - * - * Sample code: - * ``` - * $templatesServiceClient = new TemplatesServiceClient(); - * try { - * $response = $templatesServiceClient->launchTemplate(); - * } finally { - * $templatesServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Required. The ID of the Cloud Platform project that the job belongs to. - * @type bool $validateOnly - * If true, the request is validated but not actually executed. - * Defaults to false. - * @type string $gcsPath - * A Cloud Storage path to the template from which to create - * the job. - * Must be valid Cloud Storage URL, beginning with 'gs://'. - * @type DynamicTemplateLaunchParams $dynamicTemplate - * Params for launching a dynamic template. - * @type LaunchTemplateParameters $launchParameters - * The parameters of the template to launch. This should be part of the - * body of the POST request. - * @type string $location - * The [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to - * which to direct the request. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Dataflow\V1beta3\LaunchTemplateResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function launchTemplate(array $optionalArgs = []) - { - $request = new LaunchTemplateRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['validateOnly'])) { - $request->setValidateOnly($optionalArgs['validateOnly']); - } - - if (isset($optionalArgs['gcsPath'])) { - $request->setGcsPath($optionalArgs['gcsPath']); - } - - if (isset($optionalArgs['dynamicTemplate'])) { - $request->setDynamicTemplate($optionalArgs['dynamicTemplate']); - } - - if (isset($optionalArgs['launchParameters'])) { - $request->setLaunchParameters($optionalArgs['launchParameters']); - } - - if (isset($optionalArgs['location'])) { - $request->setLocation($optionalArgs['location']); - $requestParamHeaders['location'] = $optionalArgs['location']; - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'LaunchTemplate', - LaunchTemplateResponse::class, - $optionalArgs, - $request - )->wait(); - } -} diff --git a/Dataflow/src/V1beta3/GetJobExecutionDetailsRequest.php b/Dataflow/src/V1beta3/GetJobExecutionDetailsRequest.php index 395c648331c0..48f1aa7955b6 100644 --- a/Dataflow/src/V1beta3/GetJobExecutionDetailsRequest.php +++ b/Dataflow/src/V1beta3/GetJobExecutionDetailsRequest.php @@ -20,13 +20,13 @@ class GetJobExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job to get execution details for. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -34,7 +34,7 @@ class GetJobExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 3; */ - private $location = ''; + protected $location = ''; /** * If specified, determines the maximum number of stages to * return. If unspecified, the service may choose an appropriate @@ -42,7 +42,7 @@ class GetJobExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * If supplied, this should be the value of next_page_token returned * by an earlier call. This will cause the next page of results to @@ -50,7 +50,7 @@ class GetJobExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 5; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/GetJobMetricsRequest.php b/Dataflow/src/V1beta3/GetJobMetricsRequest.php index 61736ac79a40..855632b2a851 100644 --- a/Dataflow/src/V1beta3/GetJobMetricsRequest.php +++ b/Dataflow/src/V1beta3/GetJobMetricsRequest.php @@ -20,20 +20,20 @@ class GetJobMetricsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job to get metrics for. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * Return only metric data that has changed since this time. * Default is to return all information about all metrics for the job. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -41,7 +41,7 @@ class GetJobMetricsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 4; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/GetJobRequest.php b/Dataflow/src/V1beta3/GetJobRequest.php index e0302892f14f..0743b7ff6467 100644 --- a/Dataflow/src/V1beta3/GetJobRequest.php +++ b/Dataflow/src/V1beta3/GetJobRequest.php @@ -20,19 +20,19 @@ class GetJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job ID. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * The level of information requested in response. * * Generated from protobuf field .google.dataflow.v1beta3.JobView view = 3; */ - private $view = 0; + protected $view = 0; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -40,7 +40,7 @@ class GetJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 4; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/GetSnapshotRequest.php b/Dataflow/src/V1beta3/GetSnapshotRequest.php index 06021440cc62..6f7c7fda5e15 100644 --- a/Dataflow/src/V1beta3/GetSnapshotRequest.php +++ b/Dataflow/src/V1beta3/GetSnapshotRequest.php @@ -20,19 +20,19 @@ class GetSnapshotRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The ID of the snapshot. * * Generated from protobuf field string snapshot_id = 2; */ - private $snapshot_id = ''; + protected $snapshot_id = ''; /** * The location that contains this snapshot. * * Generated from protobuf field string location = 3; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/GetStageExecutionDetailsRequest.php b/Dataflow/src/V1beta3/GetStageExecutionDetailsRequest.php index 18bca57a2595..0eaa17055e9d 100644 --- a/Dataflow/src/V1beta3/GetStageExecutionDetailsRequest.php +++ b/Dataflow/src/V1beta3/GetStageExecutionDetailsRequest.php @@ -21,13 +21,13 @@ class GetStageExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job to get execution details for. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -35,13 +35,13 @@ class GetStageExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 3; */ - private $location = ''; + protected $location = ''; /** * The stage for which to fetch information. * * Generated from protobuf field string stage_id = 4; */ - private $stage_id = ''; + protected $stage_id = ''; /** * If specified, determines the maximum number of work items to * return. If unspecified, the service may choose an appropriate @@ -49,7 +49,7 @@ class GetStageExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 5; */ - private $page_size = 0; + protected $page_size = 0; /** * If supplied, this should be the value of next_page_token returned * by an earlier call. This will cause the next page of results to @@ -57,19 +57,19 @@ class GetStageExecutionDetailsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 6; */ - private $page_token = ''; + protected $page_token = ''; /** * Lower time bound of work items to include, by start time. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 7; */ - private $start_time = null; + protected $start_time = null; /** * Upper time bound of work items to include, by start time. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 8; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/GetTemplateRequest.php b/Dataflow/src/V1beta3/GetTemplateRequest.php index 7f8f0ea8aff2..a37aa7b657b3 100644 --- a/Dataflow/src/V1beta3/GetTemplateRequest.php +++ b/Dataflow/src/V1beta3/GetTemplateRequest.php @@ -20,13 +20,13 @@ class GetTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The view to retrieve. Defaults to METADATA_ONLY. * * Generated from protobuf field .google.dataflow.v1beta3.GetTemplateRequest.TemplateView view = 3; */ - private $view = 0; + protected $view = 0; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to @@ -34,7 +34,7 @@ class GetTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 4; */ - private $location = ''; + protected $location = ''; protected $template; /** diff --git a/Dataflow/src/V1beta3/GetTemplateRequest/TemplateView.php b/Dataflow/src/V1beta3/GetTemplateRequest/TemplateView.php index d44d1339ba0a..072098fe8c3e 100644 --- a/Dataflow/src/V1beta3/GetTemplateRequest/TemplateView.php +++ b/Dataflow/src/V1beta3/GetTemplateRequest/TemplateView.php @@ -46,6 +46,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TemplateView::class, \Google\Cloud\Dataflow\V1beta3\GetTemplateRequest_TemplateView::class); diff --git a/Dataflow/src/V1beta3/GetTemplateRequest_TemplateView.php b/Dataflow/src/V1beta3/GetTemplateRequest_TemplateView.php deleted file mode 100644 index 80eb035b5d7a..000000000000 --- a/Dataflow/src/V1beta3/GetTemplateRequest_TemplateView.php +++ /dev/null @@ -1,16 +0,0 @@ -.google.rpc.Status status = 1; */ - private $status = null; + protected $status = null; /** * The template metadata describing the template name, available * parameters, etc. * * Generated from protobuf field .google.dataflow.v1beta3.TemplateMetadata metadata = 2; */ - private $metadata = null; + protected $metadata = null; /** * Template Type. * * Generated from protobuf field .google.dataflow.v1beta3.GetTemplateResponse.TemplateType template_type = 3; */ - private $template_type = 0; + protected $template_type = 0; /** * Describes the runtime metadata with SDKInfo and available parameters. * * Generated from protobuf field .google.dataflow.v1beta3.RuntimeMetadata runtime_metadata = 4; */ - private $runtime_metadata = null; + protected $runtime_metadata = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/GetTemplateResponse/TemplateType.php b/Dataflow/src/V1beta3/GetTemplateResponse/TemplateType.php index e7e7f9d50cd3..a23f6d82d7c7 100644 --- a/Dataflow/src/V1beta3/GetTemplateResponse/TemplateType.php +++ b/Dataflow/src/V1beta3/GetTemplateResponse/TemplateType.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TemplateType::class, \Google\Cloud\Dataflow\V1beta3\GetTemplateResponse_TemplateType::class); diff --git a/Dataflow/src/V1beta3/GetTemplateResponse_TemplateType.php b/Dataflow/src/V1beta3/GetTemplateResponse_TemplateType.php deleted file mode 100644 index 73f43bb6c173..000000000000 --- a/Dataflow/src/V1beta3/GetTemplateResponse_TemplateType.php +++ /dev/null @@ -1,16 +0,0 @@ -string parameter = 1; */ - private $parameter = ''; + protected $parameter = ''; /** * A description of why the parameter failed to validate. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * Constructor. @@ -99,6 +99,4 @@ public function setDescription($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ParameterViolation::class, \Google\Cloud\Dataflow\V1beta3\InvalidTemplateParameters_ParameterViolation::class); diff --git a/Dataflow/src/V1beta3/InvalidTemplateParameters_ParameterViolation.php b/Dataflow/src/V1beta3/InvalidTemplateParameters_ParameterViolation.php deleted file mode 100644 index 41c7cfcf3cef..000000000000 --- a/Dataflow/src/V1beta3/InvalidTemplateParameters_ParameterViolation.php +++ /dev/null @@ -1,16 +0,0 @@ -string id = 1; */ - private $id = ''; + protected $id = ''; /** * The ID of the Cloud Platform project that the job belongs to. * * Generated from protobuf field string project_id = 2; */ - private $project_id = ''; + protected $project_id = ''; /** * The user-specified Cloud Dataflow job name. * Only one Job with a given name may exist in a project at any @@ -40,19 +40,19 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 3; */ - private $name = ''; + protected $name = ''; /** * The type of Cloud Dataflow job. * * Generated from protobuf field .google.dataflow.v1beta3.JobType type = 4; */ - private $type = 0; + protected $type = 0; /** * The environment for the job. * * Generated from protobuf field .google.dataflow.v1beta3.Environment environment = 5; */ - private $environment = null; + protected $environment = null; /** * Exactly one of step or steps_location should be specified. * The top-level steps that constitute the entire job. Only retrieved with @@ -66,7 +66,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string steps_location = 24; */ - private $steps_location = ''; + protected $steps_location = ''; /** * The current state of the job. * Jobs are created in the `JOB_STATE_STOPPED` state unless otherwise @@ -79,13 +79,13 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.JobState current_state = 7; */ - private $current_state = 0; + protected $current_state = 0; /** * The timestamp associated with the current state. * * Generated from protobuf field .google.protobuf.Timestamp current_state_time = 8; */ - private $current_state_time = null; + protected $current_state_time = null; /** * The job's requested state. * `UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and @@ -96,20 +96,20 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.JobState requested_state = 9; */ - private $requested_state = 0; + protected $requested_state = 0; /** * Deprecated. * * Generated from protobuf field .google.dataflow.v1beta3.JobExecutionInfo execution_info = 10; */ - private $execution_info = null; + protected $execution_info = null; /** * The timestamp when the job was initially created. Immutable and set by the * Cloud Dataflow service. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 11; */ - private $create_time = null; + protected $create_time = null; /** * If this job is an update of an existing job, this field is the job ID * of the job it replaced. @@ -119,7 +119,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string replace_job_id = 12; */ - private $replace_job_id = ''; + protected $replace_job_id = ''; /** * The map of transform name prefixes of the job to be replaced to the * corresponding name prefixes of the new job. @@ -138,14 +138,14 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string client_request_id = 14; */ - private $client_request_id = ''; + protected $client_request_id = ''; /** * If another job is an update of this job (and thus, this job is in * `JOB_STATE_UPDATED`), this field contains the ID of that job. * * Generated from protobuf field string replaced_by_job_id = 15; */ - private $replaced_by_job_id = ''; + protected $replaced_by_job_id = ''; /** * A set of files the system should be aware of that are used * for temporary storage. These temporary files will be @@ -179,7 +179,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 18; */ - private $location = ''; + protected $location = ''; /** * Preliminary field: The format of this data may change at any time. * A description of the user pipeline and stages through which it is executed. @@ -188,7 +188,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.PipelineDescription pipeline_description = 19; */ - private $pipeline_description = null; + protected $pipeline_description = null; /** * This field may be mutated by the Cloud Dataflow service; * callers cannot mutate it. @@ -203,7 +203,7 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.JobMetadata job_metadata = 21; */ - private $job_metadata = null; + protected $job_metadata = null; /** * The timestamp when the job was started (transitioned to JOB_STATE_PENDING). * Flexible resource scheduling jobs are started with some delay after job @@ -214,21 +214,21 @@ class Job extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 22; */ - private $start_time = null; + protected $start_time = null; /** * If this is specified, the job's initial state is populated from the given * snapshot. * * Generated from protobuf field string created_from_snapshot_id = 23; */ - private $created_from_snapshot_id = ''; + protected $created_from_snapshot_id = ''; /** * Reserved for future use. This field is set only in responses from the * server; it is ignored if it is set in any requests. * * Generated from protobuf field bool satisfies_pzs = 25; */ - private $satisfies_pzs = false; + protected $satisfies_pzs = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/JobExecutionDetails.php b/Dataflow/src/V1beta3/JobExecutionDetails.php index 7bfa6df539c9..5645aec2f176 100644 --- a/Dataflow/src/V1beta3/JobExecutionDetails.php +++ b/Dataflow/src/V1beta3/JobExecutionDetails.php @@ -28,7 +28,7 @@ class JobExecutionDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/JobMessage.php b/Dataflow/src/V1beta3/JobMessage.php index 97eb9b3f78db..ebf515bb8e04 100644 --- a/Dataflow/src/V1beta3/JobMessage.php +++ b/Dataflow/src/V1beta3/JobMessage.php @@ -20,25 +20,25 @@ class JobMessage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string id = 1; */ - private $id = ''; + protected $id = ''; /** * The timestamp of the message. * * Generated from protobuf field .google.protobuf.Timestamp time = 2; */ - private $time = null; + protected $time = null; /** * The text of the message. * * Generated from protobuf field string message_text = 3; */ - private $message_text = ''; + protected $message_text = ''; /** * Importance level of the message. * * Generated from protobuf field .google.dataflow.v1beta3.JobMessageImportance message_importance = 4; */ - private $message_importance = 0; + protected $message_importance = 0; /** * Constructor. diff --git a/Dataflow/src/V1beta3/JobMetadata.php b/Dataflow/src/V1beta3/JobMetadata.php index baace719bff1..de843e7608de 100644 --- a/Dataflow/src/V1beta3/JobMetadata.php +++ b/Dataflow/src/V1beta3/JobMetadata.php @@ -21,7 +21,7 @@ class JobMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.SdkVersion sdk_version = 1; */ - private $sdk_version = null; + protected $sdk_version = null; /** * Identification of a Spanner source used in the Dataflow job. * diff --git a/Dataflow/src/V1beta3/JobMetrics.php b/Dataflow/src/V1beta3/JobMetrics.php index b63bfbb357be..750b6885b0c2 100644 --- a/Dataflow/src/V1beta3/JobMetrics.php +++ b/Dataflow/src/V1beta3/JobMetrics.php @@ -25,7 +25,7 @@ class JobMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp metric_time = 1; */ - private $metric_time = null; + protected $metric_time = null; /** * All metrics for this job. * diff --git a/Dataflow/src/V1beta3/JobsV1Beta3Client.php b/Dataflow/src/V1beta3/JobsV1Beta3Client.php deleted file mode 100644 index 0b9314c49b6d..000000000000 --- a/Dataflow/src/V1beta3/JobsV1Beta3Client.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/CreateJob', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\Job', 'decode'], - $metadata, $options); - } - - /** - * Gets the state of the specified Cloud Dataflow job. - * - * To get the state of a job, we recommend using `projects.locations.jobs.get` - * with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.get` is not recommended, as you can only get the state of - * jobs that are running in `us-central1`. - * @param \Google\Cloud\Dataflow\V1beta3\GetJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJob(\Google\Cloud\Dataflow\V1beta3\GetJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/GetJob', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\Job', 'decode'], - $metadata, $options); - } - - /** - * Updates the state of an existing Cloud Dataflow job. - * - * To update the state of an existing job, we recommend using - * `projects.locations.jobs.update` with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using - * `projects.jobs.update` is not recommended, as you can only update the state - * of jobs that are running in `us-central1`. - * @param \Google\Cloud\Dataflow\V1beta3\UpdateJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateJob(\Google\Cloud\Dataflow\V1beta3\UpdateJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/UpdateJob', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\Job', 'decode'], - $metadata, $options); - } - - /** - * List the jobs of a project. - * - * To list the jobs of a project in a region, we recommend using - * `projects.locations.jobs.list` with a [regional endpoint] - * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To - * list the all jobs across all regions, use `projects.jobs.aggregated`. Using - * `projects.jobs.list` is not recommended, as you can only get the list of - * jobs that are running in `us-central1`. - * @param \Google\Cloud\Dataflow\V1beta3\ListJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobs(\Google\Cloud\Dataflow\V1beta3\ListJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/ListJobs', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\ListJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * List the jobs of a project across all regions. - * @param \Google\Cloud\Dataflow\V1beta3\ListJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AggregatedListJobs(\Google\Cloud\Dataflow\V1beta3\ListJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/AggregatedListJobs', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\ListJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Check for existence of active jobs in the given project across all regions. - * @param \Google\Cloud\Dataflow\V1beta3\CheckActiveJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CheckActiveJobs(\Google\Cloud\Dataflow\V1beta3\CheckActiveJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/CheckActiveJobs', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\CheckActiveJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Snapshot the state of a streaming job. - * @param \Google\Cloud\Dataflow\V1beta3\SnapshotJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SnapshotJob(\Google\Cloud\Dataflow\V1beta3\SnapshotJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.JobsV1Beta3/SnapshotJob', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\Snapshot', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataflow/src/V1beta3/KeyRangeDataDiskAssignment.php b/Dataflow/src/V1beta3/KeyRangeDataDiskAssignment.php index b8b50329b9b8..969c3ac77411 100644 --- a/Dataflow/src/V1beta3/KeyRangeDataDiskAssignment.php +++ b/Dataflow/src/V1beta3/KeyRangeDataDiskAssignment.php @@ -23,13 +23,13 @@ class KeyRangeDataDiskAssignment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string start = 1; */ - private $start = ''; + protected $start = ''; /** * The end (exclusive) of the key range. * * Generated from protobuf field string end = 2; */ - private $end = ''; + protected $end = ''; /** * The name of the data disk where data for this range is stored. * This name is local to the Google Cloud Platform project and uniquely @@ -38,7 +38,7 @@ class KeyRangeDataDiskAssignment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_disk = 3; */ - private $data_disk = ''; + protected $data_disk = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/KeyRangeLocation.php b/Dataflow/src/V1beta3/KeyRangeLocation.php index 4b70341c7ed5..e485dfde7d1b 100644 --- a/Dataflow/src/V1beta3/KeyRangeLocation.php +++ b/Dataflow/src/V1beta3/KeyRangeLocation.php @@ -22,20 +22,20 @@ class KeyRangeLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string start = 1; */ - private $start = ''; + protected $start = ''; /** * The end (exclusive) of the key range. * * Generated from protobuf field string end = 2; */ - private $end = ''; + protected $end = ''; /** * The physical location of this range assignment to be used for * streaming computation cross-worker message delivery. * * Generated from protobuf field string delivery_endpoint = 3; */ - private $delivery_endpoint = ''; + protected $delivery_endpoint = ''; /** * The name of the data disk where data for this range is stored. * This name is local to the Google Cloud Platform project and uniquely @@ -44,7 +44,7 @@ class KeyRangeLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_disk = 5; */ - private $data_disk = ''; + protected $data_disk = ''; /** * DEPRECATED. The location of the persistent state for this range, as a * persistent directory in the worker local filesystem. diff --git a/Dataflow/src/V1beta3/LaunchFlexTemplateParameter.php b/Dataflow/src/V1beta3/LaunchFlexTemplateParameter.php index 026bf18cbef7..016cf17a9e0b 100644 --- a/Dataflow/src/V1beta3/LaunchFlexTemplateParameter.php +++ b/Dataflow/src/V1beta3/LaunchFlexTemplateParameter.php @@ -21,7 +21,7 @@ class LaunchFlexTemplateParameter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string job_name = 1; */ - private $job_name = ''; + protected $job_name = ''; /** * The parameters for FlexTemplate. * Ex. {"num_workers":"5"} @@ -42,7 +42,7 @@ class LaunchFlexTemplateParameter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment environment = 7; */ - private $environment = null; + protected $environment = null; /** * Set this to true if you are sending a request to update a running * streaming job. When set, the job name should be the same as the @@ -50,7 +50,7 @@ class LaunchFlexTemplateParameter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool update = 8; */ - private $update = false; + protected $update = false; /** * Use this to pass transform_name_mappings for streaming update jobs. * Ex:{"oldTransformName":"newTransformName",...}' diff --git a/Dataflow/src/V1beta3/LaunchFlexTemplateRequest.php b/Dataflow/src/V1beta3/LaunchFlexTemplateRequest.php index 466dc532d6f4..1ee046a95135 100644 --- a/Dataflow/src/V1beta3/LaunchFlexTemplateRequest.php +++ b/Dataflow/src/V1beta3/LaunchFlexTemplateRequest.php @@ -20,13 +20,13 @@ class LaunchFlexTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * Required. Parameter to launch a job form Flex Template. * * Generated from protobuf field .google.dataflow.v1beta3.LaunchFlexTemplateParameter launch_parameter = 2; */ - private $launch_parameter = null; + protected $launch_parameter = null; /** * Required. The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to @@ -34,14 +34,14 @@ class LaunchFlexTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 3; */ - private $location = ''; + protected $location = ''; /** * If true, the request is validated but not actually executed. * Defaults to false. * * Generated from protobuf field bool validate_only = 4; */ - private $validate_only = false; + protected $validate_only = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/LaunchFlexTemplateResponse.php b/Dataflow/src/V1beta3/LaunchFlexTemplateResponse.php index 1388caa956bf..430297fab7dc 100644 --- a/Dataflow/src/V1beta3/LaunchFlexTemplateResponse.php +++ b/Dataflow/src/V1beta3/LaunchFlexTemplateResponse.php @@ -21,7 +21,7 @@ class LaunchFlexTemplateResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.Job job = 1; */ - private $job = null; + protected $job = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/LaunchTemplateParameters.php b/Dataflow/src/V1beta3/LaunchTemplateParameters.php index c7aab7351e00..dbff580ebd29 100644 --- a/Dataflow/src/V1beta3/LaunchTemplateParameters.php +++ b/Dataflow/src/V1beta3/LaunchTemplateParameters.php @@ -20,7 +20,7 @@ class LaunchTemplateParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string job_name = 1; */ - private $job_name = ''; + protected $job_name = ''; /** * The runtime parameters to pass to the job. * @@ -32,14 +32,14 @@ class LaunchTemplateParameters extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.RuntimeEnvironment environment = 3; */ - private $environment = null; + protected $environment = null; /** * If set, replace the existing pipeline with the name specified by jobName * with this pipeline, preserving state. * * Generated from protobuf field bool update = 4; */ - private $update = false; + protected $update = false; /** * Only applicable when updating a pipeline. Map of transform name prefixes of * the job to be replaced to the corresponding name prefixes of the new job. diff --git a/Dataflow/src/V1beta3/LaunchTemplateRequest.php b/Dataflow/src/V1beta3/LaunchTemplateRequest.php index d25fa56f5172..f251dc164ce2 100644 --- a/Dataflow/src/V1beta3/LaunchTemplateRequest.php +++ b/Dataflow/src/V1beta3/LaunchTemplateRequest.php @@ -20,21 +20,21 @@ class LaunchTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * If true, the request is validated but not actually executed. * Defaults to false. * * Generated from protobuf field bool validate_only = 2; */ - private $validate_only = false; + protected $validate_only = false; /** * The parameters of the template to launch. This should be part of the * body of the POST request. * * Generated from protobuf field .google.dataflow.v1beta3.LaunchTemplateParameters launch_parameters = 4; */ - private $launch_parameters = null; + protected $launch_parameters = null; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to @@ -42,7 +42,7 @@ class LaunchTemplateRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 5; */ - private $location = ''; + protected $location = ''; protected $template; /** diff --git a/Dataflow/src/V1beta3/LaunchTemplateResponse.php b/Dataflow/src/V1beta3/LaunchTemplateResponse.php index 9cd712f27cf2..30d2f305bfe9 100644 --- a/Dataflow/src/V1beta3/LaunchTemplateResponse.php +++ b/Dataflow/src/V1beta3/LaunchTemplateResponse.php @@ -21,7 +21,7 @@ class LaunchTemplateResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.Job job = 1; */ - private $job = null; + protected $job = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/ListJobMessagesRequest.php b/Dataflow/src/V1beta3/ListJobMessagesRequest.php index 3ceb832063fa..d2318ccbac0e 100644 --- a/Dataflow/src/V1beta3/ListJobMessagesRequest.php +++ b/Dataflow/src/V1beta3/ListJobMessagesRequest.php @@ -23,19 +23,19 @@ class ListJobMessagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job to get messages about. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * Filter to only get messages with importance >= level * * Generated from protobuf field .google.dataflow.v1beta3.JobMessageImportance minimum_importance = 3; */ - private $minimum_importance = 0; + protected $minimum_importance = 0; /** * If specified, determines the maximum number of messages to * return. If unspecified, the service may choose an appropriate @@ -43,7 +43,7 @@ class ListJobMessagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 4; */ - private $page_size = 0; + protected $page_size = 0; /** * If supplied, this should be the value of next_page_token returned * by an earlier call. This will cause the next page of results to @@ -51,21 +51,21 @@ class ListJobMessagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 5; */ - private $page_token = ''; + protected $page_token = ''; /** * If specified, return only messages with timestamps >= start_time. * The default is the job creation time (i.e. beginning of messages). * * Generated from protobuf field .google.protobuf.Timestamp start_time = 6; */ - private $start_time = null; + protected $start_time = null; /** * Return only messages with timestamps < end_time. The default is now * (i.e. return up to the latest messages available). * * Generated from protobuf field .google.protobuf.Timestamp end_time = 7; */ - private $end_time = null; + protected $end_time = null; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -73,7 +73,7 @@ class ListJobMessagesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 8; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/ListJobMessagesResponse.php b/Dataflow/src/V1beta3/ListJobMessagesResponse.php index 218f85493fdd..59b3f8a270fb 100644 --- a/Dataflow/src/V1beta3/ListJobMessagesResponse.php +++ b/Dataflow/src/V1beta3/ListJobMessagesResponse.php @@ -26,7 +26,7 @@ class ListJobMessagesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Autoscaling events in ascending timestamp order. * diff --git a/Dataflow/src/V1beta3/ListJobsRequest.php b/Dataflow/src/V1beta3/ListJobsRequest.php index e6ebca2d2b93..d62437d2c2d2 100644 --- a/Dataflow/src/V1beta3/ListJobsRequest.php +++ b/Dataflow/src/V1beta3/ListJobsRequest.php @@ -20,13 +20,13 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.ListJobsRequest.Filter filter = 5; */ - private $filter = 0; + protected $filter = 0; /** * The project which owns the jobs. * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * Deprecated. ListJobs always returns summaries now. * Use GetJob for other JobViews. @@ -42,14 +42,14 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 page_size = 3; */ - private $page_size = 0; + protected $page_size = 0; /** * Set this to the 'next_page_token' field of a previous response * to request additional results in a long list. * * Generated from protobuf field string page_token = 4; */ - private $page_token = ''; + protected $page_token = ''; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -57,7 +57,7 @@ class ListJobsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 17; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/ListJobsRequest/Filter.php b/Dataflow/src/V1beta3/ListJobsRequest/Filter.php index 09d6602f79b8..2e6ba07c28ec 100644 --- a/Dataflow/src/V1beta3/ListJobsRequest/Filter.php +++ b/Dataflow/src/V1beta3/ListJobsRequest/Filter.php @@ -72,6 +72,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Filter::class, \Google\Cloud\Dataflow\V1beta3\ListJobsRequest_Filter::class); diff --git a/Dataflow/src/V1beta3/ListJobsRequest_Filter.php b/Dataflow/src/V1beta3/ListJobsRequest_Filter.php deleted file mode 100644 index e53d935491db..000000000000 --- a/Dataflow/src/V1beta3/ListJobsRequest_Filter.php +++ /dev/null @@ -1,16 +0,0 @@ -string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Zero or more messages describing the [regional endpoints] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that diff --git a/Dataflow/src/V1beta3/ListSnapshotsRequest.php b/Dataflow/src/V1beta3/ListSnapshotsRequest.php index 4b2fe1a4863e..945043d38182 100644 --- a/Dataflow/src/V1beta3/ListSnapshotsRequest.php +++ b/Dataflow/src/V1beta3/ListSnapshotsRequest.php @@ -20,19 +20,19 @@ class ListSnapshotsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * If specified, list snapshots created from this job. * * Generated from protobuf field string job_id = 3; */ - private $job_id = ''; + protected $job_id = ''; /** * The location to list snapshots in. * * Generated from protobuf field string location = 2; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/MessagesV1Beta3Client.php b/Dataflow/src/V1beta3/MessagesV1Beta3Client.php deleted file mode 100644 index e064d23d6f8d..000000000000 --- a/Dataflow/src/V1beta3/MessagesV1Beta3Client.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.dataflow.v1beta3.MessagesV1Beta3/ListJobMessages', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\ListJobMessagesResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataflow/src/V1beta3/MetricStructuredName.php b/Dataflow/src/V1beta3/MetricStructuredName.php index a1ec0fe81942..d65a20f84348 100644 --- a/Dataflow/src/V1beta3/MetricStructuredName.php +++ b/Dataflow/src/V1beta3/MetricStructuredName.php @@ -22,13 +22,13 @@ class MetricStructuredName extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string origin = 1; */ - private $origin = ''; + protected $origin = ''; /** * Worker-defined metric name. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * Zero or more labeled fields which identify the part of the job this * metric is associated with, such as the name of a step or collection. diff --git a/Dataflow/src/V1beta3/MetricUpdate.php b/Dataflow/src/V1beta3/MetricUpdate.php index dca532b674d2..23006b9c23af 100644 --- a/Dataflow/src/V1beta3/MetricUpdate.php +++ b/Dataflow/src/V1beta3/MetricUpdate.php @@ -20,7 +20,7 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.MetricStructuredName name = 1; */ - private $name = null; + protected $name = null; /** * Metric aggregation kind. The possible metric aggregation kinds are * "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution". @@ -30,7 +30,7 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kind = 2; */ - private $kind = ''; + protected $kind = ''; /** * True if this metric is reported as the total cumulative aggregate * value accumulated since the worker started working on this WorkItem. @@ -39,14 +39,14 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool cumulative = 3; */ - private $cumulative = false; + protected $cumulative = false; /** * Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min", * "And", and "Or". The possible value types are Long, Double, and Boolean. * * Generated from protobuf field .google.protobuf.Value scalar = 4; */ - private $scalar = null; + protected $scalar = null; /** * Worker-computed aggregate value for the "Mean" aggregation kind. * This holds the sum of the aggregated values and is used in combination @@ -55,7 +55,7 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value mean_sum = 5; */ - private $mean_sum = null; + protected $mean_sum = null; /** * Worker-computed aggregate value for the "Mean" aggregation kind. * This holds the count of the aggregated values and is used in combination @@ -64,7 +64,7 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value mean_count = 6; */ - private $mean_count = null; + protected $mean_count = null; /** * Worker-computed aggregate value for the "Set" aggregation kind. The only * possible value type is a list of Values whose type can be Long, Double, @@ -73,13 +73,13 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value set = 7; */ - private $set = null; + protected $set = null; /** * A struct value describing properties of a distribution of numeric values. * * Generated from protobuf field .google.protobuf.Value distribution = 11; */ - private $distribution = null; + protected $distribution = null; /** * A struct value describing properties of a Gauge. * Metrics of gauge type show the value of a metric across time, and is @@ -87,14 +87,14 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Value gauge = 12; */ - private $gauge = null; + protected $gauge = null; /** * Worker-computed aggregate value for internal use by the Dataflow * service. * * Generated from protobuf field .google.protobuf.Value internal = 8; */ - private $internal = null; + protected $internal = null; /** * Timestamp associated with the metric value. Optional when workers are * reporting work progress; it will be filled in responses from the @@ -102,7 +102,7 @@ class MetricUpdate extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp update_time = 9; */ - private $update_time = null; + protected $update_time = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/MetricsV1Beta3Client.php b/Dataflow/src/V1beta3/MetricsV1Beta3Client.php deleted file mode 100644 index f0e35bc7cac5..000000000000 --- a/Dataflow/src/V1beta3/MetricsV1Beta3Client.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.dataflow.v1beta3.MetricsV1Beta3/GetJobMetrics', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\JobMetrics', 'decode'], - $metadata, $options); - } - - /** - * Request detailed information about the execution status of the job. - * - * EXPERIMENTAL. This API is subject to change or removal without notice. - * @param \Google\Cloud\Dataflow\V1beta3\GetJobExecutionDetailsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJobExecutionDetails(\Google\Cloud\Dataflow\V1beta3\GetJobExecutionDetailsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.MetricsV1Beta3/GetJobExecutionDetails', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\JobExecutionDetails', 'decode'], - $metadata, $options); - } - - /** - * Request detailed information about the execution status of a stage of the - * job. - * - * EXPERIMENTAL. This API is subject to change or removal without notice. - * @param \Google\Cloud\Dataflow\V1beta3\GetStageExecutionDetailsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetStageExecutionDetails(\Google\Cloud\Dataflow\V1beta3\GetStageExecutionDetailsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.MetricsV1Beta3/GetStageExecutionDetails', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\StageExecutionDetails', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataflow/src/V1beta3/MountedDataDisk.php b/Dataflow/src/V1beta3/MountedDataDisk.php index 0b8b54477b7a..9f01a098ac06 100644 --- a/Dataflow/src/V1beta3/MountedDataDisk.php +++ b/Dataflow/src/V1beta3/MountedDataDisk.php @@ -23,7 +23,7 @@ class MountedDataDisk extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string data_disk = 1; */ - private $data_disk = ''; + protected $data_disk = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/Package.php b/Dataflow/src/V1beta3/Package.php index ce61deb44ebf..772dc8d5c967 100644 --- a/Dataflow/src/V1beta3/Package.php +++ b/Dataflow/src/V1beta3/Package.php @@ -27,7 +27,7 @@ class Package extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * The resource to read the package from. The supported resource type is: * Google Cloud Storage: @@ -36,7 +36,7 @@ class Package extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 2; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/ParameterMetadata.php b/Dataflow/src/V1beta3/ParameterMetadata.php index bfdc62d181b7..19e648449885 100644 --- a/Dataflow/src/V1beta3/ParameterMetadata.php +++ b/Dataflow/src/V1beta3/ParameterMetadata.php @@ -20,25 +20,25 @@ class ParameterMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Required. The label to display for the parameter. * * Generated from protobuf field string label = 2; */ - private $label = ''; + protected $label = ''; /** * Required. The help text to display for the parameter. * * Generated from protobuf field string help_text = 3; */ - private $help_text = ''; + protected $help_text = ''; /** * Optional. Whether the parameter is optional. Defaults to false. * * Generated from protobuf field bool is_optional = 4; */ - private $is_optional = false; + protected $is_optional = false; /** * Optional. Regexes that the parameter must match. * @@ -51,7 +51,7 @@ class ParameterMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.ParameterType param_type = 6; */ - private $param_type = 0; + protected $param_type = 0; /** * Optional. Additional metadata for describing this parameter. * diff --git a/Dataflow/src/V1beta3/ProgressTimeseries.php b/Dataflow/src/V1beta3/ProgressTimeseries.php index 121c07a0e598..a83d098a1bfc 100644 --- a/Dataflow/src/V1beta3/ProgressTimeseries.php +++ b/Dataflow/src/V1beta3/ProgressTimeseries.php @@ -20,7 +20,7 @@ class ProgressTimeseries extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double current_progress = 1; */ - private $current_progress = 0.0; + protected $current_progress = 0.0; /** * History of progress for the component. * Points are sorted by time. diff --git a/Dataflow/src/V1beta3/ProgressTimeseries/Point.php b/Dataflow/src/V1beta3/ProgressTimeseries/Point.php index 556c60222e9c..9c6c7d251a50 100644 --- a/Dataflow/src/V1beta3/ProgressTimeseries/Point.php +++ b/Dataflow/src/V1beta3/ProgressTimeseries/Point.php @@ -20,13 +20,13 @@ class Point extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp time = 1; */ - private $time = null; + protected $time = null; /** * The value of the point. * * Generated from protobuf field double value = 2; */ - private $value = 0.0; + protected $value = 0.0; /** * Constructor. @@ -109,6 +109,4 @@ public function setValue($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Point::class, \Google\Cloud\Dataflow\V1beta3\ProgressTimeseries_Point::class); diff --git a/Dataflow/src/V1beta3/ProgressTimeseries_Point.php b/Dataflow/src/V1beta3/ProgressTimeseries_Point.php deleted file mode 100644 index f724ad40adee..000000000000 --- a/Dataflow/src/V1beta3/ProgressTimeseries_Point.php +++ /dev/null @@ -1,16 +0,0 @@ -string topic = 1; */ - private $topic = ''; + protected $topic = ''; /** * Subscription used in the connection. * * Generated from protobuf field string subscription = 2; */ - private $subscription = ''; + protected $subscription = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/PubsubLocation.php b/Dataflow/src/V1beta3/PubsubLocation.php index 0d888954065e..ef5f954f9f70 100644 --- a/Dataflow/src/V1beta3/PubsubLocation.php +++ b/Dataflow/src/V1beta3/PubsubLocation.php @@ -22,47 +22,47 @@ class PubsubLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string topic = 1; */ - private $topic = ''; + protected $topic = ''; /** * A pubsub subscription, in the form of * "pubsub.googleapis.com/subscriptions//" * * Generated from protobuf field string subscription = 2; */ - private $subscription = ''; + protected $subscription = ''; /** * If set, contains a pubsub label from which to extract record timestamps. * If left empty, record timestamps will be generated upon arrival. * * Generated from protobuf field string timestamp_label = 3; */ - private $timestamp_label = ''; + protected $timestamp_label = ''; /** * If set, contains a pubsub label from which to extract record ids. * If left empty, record deduplication will be strictly best effort. * * Generated from protobuf field string id_label = 4; */ - private $id_label = ''; + protected $id_label = ''; /** * Indicates whether the pipeline allows late-arriving data. * * Generated from protobuf field bool drop_late_data = 5; */ - private $drop_late_data = false; + protected $drop_late_data = false; /** * If set, specifies the pubsub subscription that will be used for tracking * custom time timestamps for watermark estimation. * * Generated from protobuf field string tracking_subscription = 6; */ - private $tracking_subscription = ''; + protected $tracking_subscription = ''; /** * If true, then the client has requested to get pubsub attributes. * * Generated from protobuf field bool with_attributes = 7; */ - private $with_attributes = false; + protected $with_attributes = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/PubsubSnapshotMetadata.php b/Dataflow/src/V1beta3/PubsubSnapshotMetadata.php index 6ef69bea2a17..735379d53159 100644 --- a/Dataflow/src/V1beta3/PubsubSnapshotMetadata.php +++ b/Dataflow/src/V1beta3/PubsubSnapshotMetadata.php @@ -20,19 +20,19 @@ class PubsubSnapshotMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string topic_name = 1; */ - private $topic_name = ''; + protected $topic_name = ''; /** * The name of the Pubsub snapshot. * * Generated from protobuf field string snapshot_name = 2; */ - private $snapshot_name = ''; + protected $snapshot_name = ''; /** * The expire time of the Pubsub snapshot. * * Generated from protobuf field .google.protobuf.Timestamp expire_time = 3; */ - private $expire_time = null; + protected $expire_time = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/RuntimeEnvironment.php b/Dataflow/src/V1beta3/RuntimeEnvironment.php index 1e7c8438d005..db078f09e5c1 100644 --- a/Dataflow/src/V1beta3/RuntimeEnvironment.php +++ b/Dataflow/src/V1beta3/RuntimeEnvironment.php @@ -20,14 +20,14 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 num_workers = 11; */ - private $num_workers = 0; + protected $num_workers = 0; /** * The maximum number of Google Compute Engine instances to be made * available to your pipeline during execution, from 1 to 1000. * * Generated from protobuf field int32 max_workers = 1; */ - private $max_workers = 0; + protected $max_workers = 0; /** * The Compute Engine [availability * zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) @@ -36,34 +36,34 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string zone = 2; */ - private $zone = ''; + protected $zone = ''; /** * The email address of the service account to run the job as. * * Generated from protobuf field string service_account_email = 3; */ - private $service_account_email = ''; + protected $service_account_email = ''; /** * The Cloud Storage path to use for temporary files. * Must be a valid Cloud Storage URL, beginning with `gs://`. * * Generated from protobuf field string temp_location = 4; */ - private $temp_location = ''; + protected $temp_location = ''; /** * Whether to bypass the safety checks for the job's temporary directory. * Use with caution. * * Generated from protobuf field bool bypass_temp_dir_validation = 5; */ - private $bypass_temp_dir_validation = false; + protected $bypass_temp_dir_validation = false; /** * The machine type to use for the job. Defaults to the value from the * template if not specified. * * Generated from protobuf field string machine_type = 6; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Additional experiment flags for the job, specified with the * `--experiments` option. @@ -77,7 +77,7 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string network = 8; */ - private $network = ''; + protected $network = ''; /** * Subnetwork to which VMs will be assigned, if desired. You can specify a * subnetwork using either a complete URL or an abbreviated path. Expected to @@ -88,7 +88,7 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string subnetwork = 9; */ - private $subnetwork = ''; + protected $subnetwork = ''; /** * Additional user labels to be specified for the job. * Keys and values should follow the restrictions specified in the [labeling @@ -107,13 +107,13 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kms_key_name = 12; */ - private $kms_key_name = ''; + protected $kms_key_name = ''; /** * Configuration for VM IPs. * * Generated from protobuf field .google.dataflow.v1beta3.WorkerIPAddressConfiguration ip_configuration = 14; */ - private $ip_configuration = 0; + protected $ip_configuration = 0; /** * The Compute Engine region * (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in @@ -123,7 +123,7 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_region = 15; */ - private $worker_region = ''; + protected $worker_region = ''; /** * The Compute Engine zone * (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in @@ -134,13 +134,13 @@ class RuntimeEnvironment extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_zone = 16; */ - private $worker_zone = ''; + protected $worker_zone = ''; /** * Whether to enable Streaming Engine for the job. * * Generated from protobuf field bool enable_streaming_engine = 17; */ - private $enable_streaming_engine = false; + protected $enable_streaming_engine = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/RuntimeMetadata.php b/Dataflow/src/V1beta3/RuntimeMetadata.php index ec22d9257d1d..07b47f697cde 100644 --- a/Dataflow/src/V1beta3/RuntimeMetadata.php +++ b/Dataflow/src/V1beta3/RuntimeMetadata.php @@ -20,7 +20,7 @@ class RuntimeMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.SDKInfo sdk_info = 1; */ - private $sdk_info = null; + protected $sdk_info = null; /** * The parameters for the template. * diff --git a/Dataflow/src/V1beta3/SDKInfo.php b/Dataflow/src/V1beta3/SDKInfo.php index 1c4e74ecfc33..8396a1fe7ebc 100644 --- a/Dataflow/src/V1beta3/SDKInfo.php +++ b/Dataflow/src/V1beta3/SDKInfo.php @@ -20,13 +20,13 @@ class SDKInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.SDKInfo.Language language = 1; */ - private $language = 0; + protected $language = 0; /** * Optional. The SDK version. * * Generated from protobuf field string version = 2; */ - private $version = ''; + protected $version = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/SDKInfo/Language.php b/Dataflow/src/V1beta3/SDKInfo/Language.php index a5329e29ef80..74c84c130d95 100644 --- a/Dataflow/src/V1beta3/SDKInfo/Language.php +++ b/Dataflow/src/V1beta3/SDKInfo/Language.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Language::class, \Google\Cloud\Dataflow\V1beta3\SDKInfo_Language::class); diff --git a/Dataflow/src/V1beta3/SDKInfo_Language.php b/Dataflow/src/V1beta3/SDKInfo_Language.php deleted file mode 100644 index c38335c0f64f..000000000000 --- a/Dataflow/src/V1beta3/SDKInfo_Language.php +++ /dev/null @@ -1,16 +0,0 @@ -string container_image = 1; */ - private $container_image = ''; + protected $container_image = ''; /** * If true, recommends the Dataflow service to use only one core per SDK * container instance with this image. If false (or unset) recommends using @@ -30,14 +30,14 @@ class SdkHarnessContainerImage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool use_single_core_per_container = 2; */ - private $use_single_core_per_container = false; + protected $use_single_core_per_container = false; /** * Environment ID for the Beam runner API proto Environment that corresponds * to the current SDK Harness. * * Generated from protobuf field string environment_id = 3; */ - private $environment_id = ''; + protected $environment_id = ''; /** * The set of capabilities enumerated in the above Environment proto. See also * https://github.com/apache/beam/blob/master/model/pipeline/src/main/proto/beam_runner_api.proto diff --git a/Dataflow/src/V1beta3/SdkVersion.php b/Dataflow/src/V1beta3/SdkVersion.php index 16cf08972ef7..2dadc75ced64 100644 --- a/Dataflow/src/V1beta3/SdkVersion.php +++ b/Dataflow/src/V1beta3/SdkVersion.php @@ -20,19 +20,19 @@ class SdkVersion extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string version = 1; */ - private $version = ''; + protected $version = ''; /** * A readable string describing the version of the SDK. * * Generated from protobuf field string version_display_name = 2; */ - private $version_display_name = ''; + protected $version_display_name = ''; /** * The support status for this SDK version. * * Generated from protobuf field .google.dataflow.v1beta3.SdkVersion.SdkSupportStatus sdk_support_status = 3; */ - private $sdk_support_status = 0; + protected $sdk_support_status = 0; /** * Constructor. diff --git a/Dataflow/src/V1beta3/SdkVersion/SdkSupportStatus.php b/Dataflow/src/V1beta3/SdkVersion/SdkSupportStatus.php index cede66359d07..7c39e1abadc1 100644 --- a/Dataflow/src/V1beta3/SdkVersion/SdkSupportStatus.php +++ b/Dataflow/src/V1beta3/SdkVersion/SdkSupportStatus.php @@ -74,6 +74,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SdkSupportStatus::class, \Google\Cloud\Dataflow\V1beta3\SdkVersion_SdkSupportStatus::class); diff --git a/Dataflow/src/V1beta3/SdkVersion_SdkSupportStatus.php b/Dataflow/src/V1beta3/SdkVersion_SdkSupportStatus.php deleted file mode 100644 index 7316218d0a96..000000000000 --- a/Dataflow/src/V1beta3/SdkVersion_SdkSupportStatus.php +++ /dev/null @@ -1,16 +0,0 @@ -string id = 1; */ - private $id = ''; + protected $id = ''; /** * The project this snapshot belongs to. * * Generated from protobuf field string project_id = 2; */ - private $project_id = ''; + protected $project_id = ''; /** * The job this snapshot was created from. * * Generated from protobuf field string source_job_id = 3; */ - private $source_job_id = ''; + protected $source_job_id = ''; /** * The time this snapshot was created. * * Generated from protobuf field .google.protobuf.Timestamp creation_time = 4; */ - private $creation_time = null; + protected $creation_time = null; /** * The time after which this snapshot will be automatically deleted. * * Generated from protobuf field .google.protobuf.Duration ttl = 5; */ - private $ttl = null; + protected $ttl = null; /** * State of the snapshot. * * Generated from protobuf field .google.dataflow.v1beta3.SnapshotState state = 6; */ - private $state = 0; + protected $state = 0; /** * Pub/Sub snapshot metadata. * @@ -62,20 +62,20 @@ class Snapshot extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string description = 8; */ - private $description = ''; + protected $description = ''; /** * The disk byte size of the snapshot. Only available for snapshots in READY * state. * * Generated from protobuf field int64 disk_size_bytes = 9; */ - private $disk_size_bytes = 0; + protected $disk_size_bytes = 0; /** * Cloud region where this snapshot lives in, e.g., "us-central1". * * Generated from protobuf field string region = 10; */ - private $region = ''; + protected $region = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/SnapshotJobRequest.php b/Dataflow/src/V1beta3/SnapshotJobRequest.php index ebfd11cca342..551d6dcfd79b 100644 --- a/Dataflow/src/V1beta3/SnapshotJobRequest.php +++ b/Dataflow/src/V1beta3/SnapshotJobRequest.php @@ -20,37 +20,37 @@ class SnapshotJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job to be snapshotted. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * TTL for the snapshot. * * Generated from protobuf field .google.protobuf.Duration ttl = 3; */ - private $ttl = null; + protected $ttl = null; /** * The location that contains this job. * * Generated from protobuf field string location = 4; */ - private $location = ''; + protected $location = ''; /** * If true, perform snapshots for sources which support this. * * Generated from protobuf field bool snapshot_sources = 5; */ - private $snapshot_sources = false; + protected $snapshot_sources = false; /** * User specified description of the snapshot. Maybe empty. * * Generated from protobuf field string description = 6; */ - private $description = ''; + protected $description = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/SnapshotsV1Beta3Client.php b/Dataflow/src/V1beta3/SnapshotsV1Beta3Client.php deleted file mode 100644 index b0344df3971d..000000000000 --- a/Dataflow/src/V1beta3/SnapshotsV1Beta3Client.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.dataflow.v1beta3.SnapshotsV1Beta3/GetSnapshot', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\Snapshot', 'decode'], - $metadata, $options); - } - - /** - * Deletes a snapshot. - * @param \Google\Cloud\Dataflow\V1beta3\DeleteSnapshotRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteSnapshot(\Google\Cloud\Dataflow\V1beta3\DeleteSnapshotRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.SnapshotsV1Beta3/DeleteSnapshot', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\DeleteSnapshotResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists snapshots. - * @param \Google\Cloud\Dataflow\V1beta3\ListSnapshotsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListSnapshots(\Google\Cloud\Dataflow\V1beta3\ListSnapshotsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.SnapshotsV1Beta3/ListSnapshots', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\ListSnapshotsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataflow/src/V1beta3/SpannerIODetails.php b/Dataflow/src/V1beta3/SpannerIODetails.php index ba63126c163b..62b48f08932e 100644 --- a/Dataflow/src/V1beta3/SpannerIODetails.php +++ b/Dataflow/src/V1beta3/SpannerIODetails.php @@ -20,19 +20,19 @@ class SpannerIODetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * InstanceId accessed in the connection. * * Generated from protobuf field string instance_id = 2; */ - private $instance_id = ''; + protected $instance_id = ''; /** * DatabaseId accessed in the connection. * * Generated from protobuf field string database_id = 3; */ - private $database_id = ''; + protected $database_id = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/StageExecutionDetails.php b/Dataflow/src/V1beta3/StageExecutionDetails.php index ad31e7996562..bc7ff2169c1b 100644 --- a/Dataflow/src/V1beta3/StageExecutionDetails.php +++ b/Dataflow/src/V1beta3/StageExecutionDetails.php @@ -28,7 +28,7 @@ class StageExecutionDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/StageSummary.php b/Dataflow/src/V1beta3/StageSummary.php index 49a8d00d92f0..309520e37e5b 100644 --- a/Dataflow/src/V1beta3/StageSummary.php +++ b/Dataflow/src/V1beta3/StageSummary.php @@ -20,19 +20,19 @@ class StageSummary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string stage_id = 1; */ - private $stage_id = ''; + protected $stage_id = ''; /** * State of this stage. * * Generated from protobuf field .google.dataflow.v1beta3.ExecutionState state = 2; */ - private $state = 0; + protected $state = 0; /** * Start time of this stage. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * End time of this stage. * If the work item is completed, this is the actual end time of the stage. @@ -40,14 +40,14 @@ class StageSummary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; */ - private $end_time = null; + protected $end_time = null; /** * Progress for this stage. * Only applicable to Batch jobs. * * Generated from protobuf field .google.dataflow.v1beta3.ProgressTimeseries progress = 5; */ - private $progress = null; + protected $progress = null; /** * Metrics for this stage. * diff --git a/Dataflow/src/V1beta3/StateFamilyConfig.php b/Dataflow/src/V1beta3/StateFamilyConfig.php index 73d2735fd4c5..530224f6bceb 100644 --- a/Dataflow/src/V1beta3/StateFamilyConfig.php +++ b/Dataflow/src/V1beta3/StateFamilyConfig.php @@ -20,13 +20,13 @@ class StateFamilyConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string state_family = 1; */ - private $state_family = ''; + protected $state_family = ''; /** * If true, this family corresponds to a read operation. * * Generated from protobuf field bool is_read = 2; */ - private $is_read = false; + protected $is_read = false; /** * Constructor. diff --git a/Dataflow/src/V1beta3/Step.php b/Dataflow/src/V1beta3/Step.php index ef43e512e598..b1812ca44bd0 100644 --- a/Dataflow/src/V1beta3/Step.php +++ b/Dataflow/src/V1beta3/Step.php @@ -36,14 +36,14 @@ class Step extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kind = 1; */ - private $kind = ''; + protected $kind = ''; /** * The name that identifies the step. This must be unique for each * step with respect to all other steps in the Cloud Dataflow job. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * Named properties associated with the step. Each kind of * predefined step has its own required set of properties. @@ -51,7 +51,7 @@ class Step extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Struct properties = 3; */ - private $properties = null; + protected $properties = null; /** * Constructor. diff --git a/Dataflow/src/V1beta3/StreamingApplianceSnapshotConfig.php b/Dataflow/src/V1beta3/StreamingApplianceSnapshotConfig.php index ddec77baa300..2cb32a367395 100644 --- a/Dataflow/src/V1beta3/StreamingApplianceSnapshotConfig.php +++ b/Dataflow/src/V1beta3/StreamingApplianceSnapshotConfig.php @@ -20,13 +20,13 @@ class StreamingApplianceSnapshotConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string snapshot_id = 1; */ - private $snapshot_id = ''; + protected $snapshot_id = ''; /** * Indicates which endpoint is used to import appliance state. * * Generated from protobuf field string import_state_endpoint = 2; */ - private $import_state_endpoint = ''; + protected $import_state_endpoint = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/StreamingComputationRanges.php b/Dataflow/src/V1beta3/StreamingComputationRanges.php index 0cd329a0243c..132aeaf5df3c 100644 --- a/Dataflow/src/V1beta3/StreamingComputationRanges.php +++ b/Dataflow/src/V1beta3/StreamingComputationRanges.php @@ -21,7 +21,7 @@ class StreamingComputationRanges extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string computation_id = 1; */ - private $computation_id = ''; + protected $computation_id = ''; /** * Data disk assignments for ranges from this computation. * diff --git a/Dataflow/src/V1beta3/StreamingSideInputLocation.php b/Dataflow/src/V1beta3/StreamingSideInputLocation.php index a8842f7b4ef9..a4179ca4236b 100644 --- a/Dataflow/src/V1beta3/StreamingSideInputLocation.php +++ b/Dataflow/src/V1beta3/StreamingSideInputLocation.php @@ -20,13 +20,13 @@ class StreamingSideInputLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string tag = 1; */ - private $tag = ''; + protected $tag = ''; /** * Identifies the state family where this side input is stored. * * Generated from protobuf field string state_family = 2; */ - private $state_family = ''; + protected $state_family = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/StreamingStageLocation.php b/Dataflow/src/V1beta3/StreamingStageLocation.php index bbbb563529b5..a6b9abb8c3d4 100644 --- a/Dataflow/src/V1beta3/StreamingStageLocation.php +++ b/Dataflow/src/V1beta3/StreamingStageLocation.php @@ -22,7 +22,7 @@ class StreamingStageLocation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string stream_id = 1; */ - private $stream_id = ''; + protected $stream_id = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/StructuredMessage.php b/Dataflow/src/V1beta3/StructuredMessage.php index 638a7d67a067..acfb9370c64d 100644 --- a/Dataflow/src/V1beta3/StructuredMessage.php +++ b/Dataflow/src/V1beta3/StructuredMessage.php @@ -22,14 +22,14 @@ class StructuredMessage extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string message_text = 1; */ - private $message_text = ''; + protected $message_text = ''; /** * Identifier for this message type. Used by external systems to * internationalize or personalize message. * * Generated from protobuf field string message_key = 2; */ - private $message_key = ''; + protected $message_key = ''; /** * The structured data associated with this message. * diff --git a/Dataflow/src/V1beta3/StructuredMessage/Parameter.php b/Dataflow/src/V1beta3/StructuredMessage/Parameter.php index 58f7102e6ee7..55fc9ba00dac 100644 --- a/Dataflow/src/V1beta3/StructuredMessage/Parameter.php +++ b/Dataflow/src/V1beta3/StructuredMessage/Parameter.php @@ -20,13 +20,13 @@ class Parameter extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * Value for this parameter. * * Generated from protobuf field .google.protobuf.Value value = 2; */ - private $value = null; + protected $value = null; /** * Constructor. @@ -109,6 +109,4 @@ public function setValue($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Parameter::class, \Google\Cloud\Dataflow\V1beta3\StructuredMessage_Parameter::class); diff --git a/Dataflow/src/V1beta3/StructuredMessage_Parameter.php b/Dataflow/src/V1beta3/StructuredMessage_Parameter.php deleted file mode 100644 index 270dcdd72015..000000000000 --- a/Dataflow/src/V1beta3/StructuredMessage_Parameter.php +++ /dev/null @@ -1,16 +0,0 @@ -string task_user = 1; */ - private $task_user = ''; + protected $task_user = ''; /** * The UNIX group ID on the worker VM to use for tasks launched by * taskrunner; e.g. "wheel". * * Generated from protobuf field string task_group = 2; */ - private $task_group = ''; + protected $task_group = ''; /** * The OAuth2 scopes to be requested by the taskrunner in order to * access the Cloud Dataflow API. @@ -47,44 +47,44 @@ class TaskRunnerSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string base_url = 4; */ - private $base_url = ''; + protected $base_url = ''; /** * The API version of endpoint, e.g. "v1b3" * * Generated from protobuf field string dataflow_api_version = 5; */ - private $dataflow_api_version = ''; + protected $dataflow_api_version = ''; /** * The settings to pass to the parallel worker harness. * * Generated from protobuf field .google.dataflow.v1beta3.WorkerSettings parallel_worker_settings = 6; */ - private $parallel_worker_settings = null; + protected $parallel_worker_settings = null; /** * The location on the worker for task-specific subdirectories. * * Generated from protobuf field string base_task_dir = 7; */ - private $base_task_dir = ''; + protected $base_task_dir = ''; /** * Whether to continue taskrunner if an exception is hit. * * Generated from protobuf field bool continue_on_exception = 8; */ - private $continue_on_exception = false; + protected $continue_on_exception = false; /** * Whether to send taskrunner log info to Google Compute Engine VM serial * console. * * Generated from protobuf field bool log_to_serialconsole = 9; */ - private $log_to_serialconsole = false; + protected $log_to_serialconsole = false; /** * Whether to also send taskrunner log info to stderr. * * Generated from protobuf field bool alsologtostderr = 10; */ - private $alsologtostderr = false; + protected $alsologtostderr = false; /** * Indicates where to put logs. If this is not specified, the logs * will not be uploaded. @@ -95,13 +95,13 @@ class TaskRunnerSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string log_upload_location = 11; */ - private $log_upload_location = ''; + protected $log_upload_location = ''; /** * The directory on the VM to store logs. * * Generated from protobuf field string log_dir = 12; */ - private $log_dir = ''; + protected $log_dir = ''; /** * The prefix of the resources the taskrunner should use for * temporary storage. @@ -112,43 +112,43 @@ class TaskRunnerSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string temp_storage_prefix = 13; */ - private $temp_storage_prefix = ''; + protected $temp_storage_prefix = ''; /** * The command to launch the worker harness. * * Generated from protobuf field string harness_command = 14; */ - private $harness_command = ''; + protected $harness_command = ''; /** * The file to store the workflow in. * * Generated from protobuf field string workflow_file_name = 15; */ - private $workflow_file_name = ''; + protected $workflow_file_name = ''; /** * The file to store preprocessing commands in. * * Generated from protobuf field string commandlines_file_name = 16; */ - private $commandlines_file_name = ''; + protected $commandlines_file_name = ''; /** * The ID string of the VM. * * Generated from protobuf field string vm_id = 17; */ - private $vm_id = ''; + protected $vm_id = ''; /** * The suggested backend language. * * Generated from protobuf field string language_hint = 18; */ - private $language_hint = ''; + protected $language_hint = ''; /** * The streaming worker main class name. * * Generated from protobuf field string streaming_worker_main_class = 19; */ - private $streaming_worker_main_class = ''; + protected $streaming_worker_main_class = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/TemplateMetadata.php b/Dataflow/src/V1beta3/TemplateMetadata.php index 1465f7595043..a8b7dca86120 100644 --- a/Dataflow/src/V1beta3/TemplateMetadata.php +++ b/Dataflow/src/V1beta3/TemplateMetadata.php @@ -20,13 +20,13 @@ class TemplateMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Optional. A description of the template. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * The parameters for the template. * diff --git a/Dataflow/src/V1beta3/TemplatesServiceClient.php b/Dataflow/src/V1beta3/TemplatesServiceClient.php deleted file mode 100644 index d2d89abf6838..000000000000 --- a/Dataflow/src/V1beta3/TemplatesServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.dataflow.v1beta3.TemplatesService/CreateJobFromTemplate', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\Job', 'decode'], - $metadata, $options); - } - - /** - * Launch a template. - * @param \Google\Cloud\Dataflow\V1beta3\LaunchTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function LaunchTemplate(\Google\Cloud\Dataflow\V1beta3\LaunchTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.TemplatesService/LaunchTemplate', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\LaunchTemplateResponse', 'decode'], - $metadata, $options); - } - - /** - * Get the template associated with a template. - * @param \Google\Cloud\Dataflow\V1beta3\GetTemplateRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTemplate(\Google\Cloud\Dataflow\V1beta3\GetTemplateRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.dataflow.v1beta3.TemplatesService/GetTemplate', - $argument, - ['\Google\Cloud\Dataflow\V1beta3\GetTemplateResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/Dataflow/src/V1beta3/TopologyConfig.php b/Dataflow/src/V1beta3/TopologyConfig.php index 1339aa56eb30..90236fec73d2 100644 --- a/Dataflow/src/V1beta3/TopologyConfig.php +++ b/Dataflow/src/V1beta3/TopologyConfig.php @@ -39,13 +39,13 @@ class TopologyConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 forwarding_key_bits = 4; */ - private $forwarding_key_bits = 0; + protected $forwarding_key_bits = 0; /** * Version number for persistent state. * * Generated from protobuf field int32 persistent_state_version = 5; */ - private $persistent_state_version = 0; + protected $persistent_state_version = 0; /** * Constructor. diff --git a/Dataflow/src/V1beta3/TransformSummary.php b/Dataflow/src/V1beta3/TransformSummary.php index eeb8035824ed..dd9570904b78 100644 --- a/Dataflow/src/V1beta3/TransformSummary.php +++ b/Dataflow/src/V1beta3/TransformSummary.php @@ -20,19 +20,19 @@ class TransformSummary extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.KindType kind = 1; */ - private $kind = 0; + protected $kind = 0; /** * SDK generated id of this transform instance. * * Generated from protobuf field string id = 2; */ - private $id = ''; + protected $id = ''; /** * User provided name for this transform instance. * * Generated from protobuf field string name = 3; */ - private $name = ''; + protected $name = ''; /** * Transform-specific display data. * diff --git a/Dataflow/src/V1beta3/UpdateJobRequest.php b/Dataflow/src/V1beta3/UpdateJobRequest.php index c372b70959e8..e261f4170d93 100644 --- a/Dataflow/src/V1beta3/UpdateJobRequest.php +++ b/Dataflow/src/V1beta3/UpdateJobRequest.php @@ -20,20 +20,20 @@ class UpdateJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string project_id = 1; */ - private $project_id = ''; + protected $project_id = ''; /** * The job ID. * * Generated from protobuf field string job_id = 2; */ - private $job_id = ''; + protected $job_id = ''; /** * The updated job. * Only the job state is updatable; other fields will be ignored. * * Generated from protobuf field .google.dataflow.v1beta3.Job job = 3; */ - private $job = null; + protected $job = null; /** * The [regional endpoint] * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that @@ -41,7 +41,7 @@ class UpdateJobRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string location = 4; */ - private $location = ''; + protected $location = ''; /** * Constructor. diff --git a/Dataflow/src/V1beta3/WorkItemDetails.php b/Dataflow/src/V1beta3/WorkItemDetails.php index a2997728ba4c..75b9ad2db503 100644 --- a/Dataflow/src/V1beta3/WorkItemDetails.php +++ b/Dataflow/src/V1beta3/WorkItemDetails.php @@ -20,19 +20,19 @@ class WorkItemDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string task_id = 1; */ - private $task_id = ''; + protected $task_id = ''; /** * Attempt ID of this work item * * Generated from protobuf field string attempt_id = 2; */ - private $attempt_id = ''; + protected $attempt_id = ''; /** * Start time of this work item attempt. * * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; */ - private $start_time = null; + protected $start_time = null; /** * End time of this work item attempt. * If the work item is completed, this is the actual end time of the work @@ -40,19 +40,19 @@ class WorkItemDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp end_time = 4; */ - private $end_time = null; + protected $end_time = null; /** * State of this work item. * * Generated from protobuf field .google.dataflow.v1beta3.ExecutionState state = 5; */ - private $state = 0; + protected $state = 0; /** * Progress of this work item. * * Generated from protobuf field .google.dataflow.v1beta3.ProgressTimeseries progress = 6; */ - private $progress = null; + protected $progress = null; /** * Metrics for this work item. * diff --git a/Dataflow/src/V1beta3/WorkerDetails.php b/Dataflow/src/V1beta3/WorkerDetails.php index c508d378fb44..e9cf5e8027e6 100644 --- a/Dataflow/src/V1beta3/WorkerDetails.php +++ b/Dataflow/src/V1beta3/WorkerDetails.php @@ -20,7 +20,7 @@ class WorkerDetails extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_name = 1; */ - private $worker_name = ''; + protected $worker_name = ''; /** * Work items processed by this worker, sorted by time. * diff --git a/Dataflow/src/V1beta3/WorkerPool.php b/Dataflow/src/V1beta3/WorkerPool.php index 4b5bc9bf66ff..aa331fbcc11d 100644 --- a/Dataflow/src/V1beta3/WorkerPool.php +++ b/Dataflow/src/V1beta3/WorkerPool.php @@ -25,7 +25,7 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string kind = 1; */ - private $kind = ''; + protected $kind = ''; /** * Number of Google Compute Engine workers in this pool needed to * execute the job. If zero or unspecified, the service will @@ -33,7 +33,7 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 num_workers = 2; */ - private $num_workers = 0; + protected $num_workers = 0; /** * Packages to be installed on workers. * @@ -47,14 +47,14 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.DefaultPackageSet default_package_set = 4; */ - private $default_package_set = 0; + protected $default_package_set = 0; /** * Machine type (e.g. "n1-standard-1"). If empty or unspecified, the * service will attempt to choose a reasonable default. * * Generated from protobuf field string machine_type = 5; */ - private $machine_type = ''; + protected $machine_type = ''; /** * Sets the policy for determining when to turndown worker pool. * Allowed values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and @@ -73,34 +73,34 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.TeardownPolicy teardown_policy = 6; */ - private $teardown_policy = 0; + protected $teardown_policy = 0; /** * Size of root disk for VMs, in GB. If zero or unspecified, the service will * attempt to choose a reasonable default. * * Generated from protobuf field int32 disk_size_gb = 7; */ - private $disk_size_gb = 0; + protected $disk_size_gb = 0; /** * Type of root disk for VMs. If empty or unspecified, the service will * attempt to choose a reasonable default. * * Generated from protobuf field string disk_type = 16; */ - private $disk_type = ''; + protected $disk_type = ''; /** * Fully qualified source image for disks. * * Generated from protobuf field string disk_source_image = 8; */ - private $disk_source_image = ''; + protected $disk_source_image = ''; /** * Zone to run the worker pools in. If empty or unspecified, the service * will attempt to choose a reasonable default. * * Generated from protobuf field string zone = 9; */ - private $zone = ''; + protected $zone = ''; /** * Settings passed through to Google Compute Engine workers when * using the standard Dataflow task runner. Users should ignore @@ -108,14 +108,14 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.TaskRunnerSettings taskrunner_settings = 10; */ - private $taskrunner_settings = null; + protected $taskrunner_settings = null; /** * The action to take on host maintenance, as defined by the Google * Compute Engine API. * * Generated from protobuf field string on_host_maintenance = 11; */ - private $on_host_maintenance = ''; + protected $on_host_maintenance = ''; /** * Data disks that are used by a VM in this workflow. * @@ -133,27 +133,27 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.dataflow.v1beta3.AutoscalingSettings autoscaling_settings = 14; */ - private $autoscaling_settings = null; + protected $autoscaling_settings = null; /** * Extra arguments for this worker pool. * * Generated from protobuf field .google.protobuf.Any pool_args = 15; */ - private $pool_args = null; + protected $pool_args = null; /** * Network to which VMs will be assigned. If empty or unspecified, * the service will use the network "default". * * Generated from protobuf field string network = 17; */ - private $network = ''; + protected $network = ''; /** * Subnetwork to which VMs will be assigned, if desired. Expected to be of * the form "regions/REGION/subnetworks/SUBNETWORK". * * Generated from protobuf field string subnetwork = 19; */ - private $subnetwork = ''; + protected $subnetwork = ''; /** * Required. Docker container image that executes the Cloud Dataflow worker * harness, residing in Google Container Registry. @@ -161,7 +161,7 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string worker_harness_container_image = 18; */ - private $worker_harness_container_image = ''; + protected $worker_harness_container_image = ''; /** * The number of threads per worker harness. If empty or unspecified, the * service will choose a number of threads (according to the number of cores @@ -169,13 +169,13 @@ class WorkerPool extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int32 num_threads_per_worker = 20; */ - private $num_threads_per_worker = 0; + protected $num_threads_per_worker = 0; /** * Configuration for VM IPs. * * Generated from protobuf field .google.dataflow.v1beta3.WorkerIPAddressConfiguration ip_configuration = 21; */ - private $ip_configuration = 0; + protected $ip_configuration = 0; /** * Set of SDK harness containers needed to execute this pipeline. This will * only be set in the Fn API path. For non-cross-language pipelines this diff --git a/Dataflow/src/V1beta3/WorkerSettings.php b/Dataflow/src/V1beta3/WorkerSettings.php index 49c82cfa41e1..d62549d6fb3c 100644 --- a/Dataflow/src/V1beta3/WorkerSettings.php +++ b/Dataflow/src/V1beta3/WorkerSettings.php @@ -26,33 +26,33 @@ class WorkerSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string base_url = 1; */ - private $base_url = ''; + protected $base_url = ''; /** * Whether to send work progress updates to the service. * * Generated from protobuf field bool reporting_enabled = 2; */ - private $reporting_enabled = false; + protected $reporting_enabled = false; /** * The Cloud Dataflow service path relative to the root URL, for example, * "dataflow/v1b3/projects". * * Generated from protobuf field string service_path = 3; */ - private $service_path = ''; + protected $service_path = ''; /** * The Shuffle service path relative to the root URL, for example, * "shuffle/v1beta1". * * Generated from protobuf field string shuffle_service_path = 4; */ - private $shuffle_service_path = ''; + protected $shuffle_service_path = ''; /** * The ID of the worker running this pipeline. * * Generated from protobuf field string worker_id = 5; */ - private $worker_id = ''; + protected $worker_id = ''; /** * The prefix of the resources the system should use for temporary * storage. @@ -63,7 +63,7 @@ class WorkerSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string temp_storage_prefix = 6; */ - private $temp_storage_prefix = ''; + protected $temp_storage_prefix = ''; /** * Constructor. diff --git a/Dataflow/tests/Unit/V1beta3/Client/FlexTemplatesServiceClientTest.php b/Dataflow/tests/Unit/V1beta3/Client/FlexTemplatesServiceClientTest.php index 8d54cbd10790..9cd71f5c5d53 100644 --- a/Dataflow/tests/Unit/V1beta3/Client/FlexTemplatesServiceClientTest.php +++ b/Dataflow/tests/Unit/V1beta3/Client/FlexTemplatesServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return FlexTemplatesServiceClient */ @@ -93,12 +95,15 @@ public function launchFlexTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new LaunchFlexTemplateRequest(); try { diff --git a/Dataflow/tests/Unit/V1beta3/Client/JobsV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/Client/JobsV1Beta3ClientTest.php index 21b377883026..cee69c54002c 100644 --- a/Dataflow/tests/Unit/V1beta3/Client/JobsV1Beta3ClientTest.php +++ b/Dataflow/tests/Unit/V1beta3/Client/JobsV1Beta3ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return JobsV1Beta3Client */ @@ -79,9 +81,7 @@ public function aggregatedListJobsTest() // Mock response $nextPageToken = ''; $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; + $jobs = [$jobsElement]; $expectedResponse = new ListJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobs($jobs); @@ -111,12 +111,15 @@ public function aggregatedListJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListJobsRequest(); try { @@ -167,12 +170,15 @@ public function checkActiveJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new CheckActiveJobsRequest(); try { @@ -241,12 +247,15 @@ public function createJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new CreateJobRequest(); try { @@ -315,12 +324,15 @@ public function getJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetJobRequest(); try { @@ -347,9 +359,7 @@ public function listJobsTest() // Mock response $nextPageToken = ''; $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; + $jobs = [$jobsElement]; $expectedResponse = new ListJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobs($jobs); @@ -379,12 +389,15 @@ public function listJobsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListJobsRequest(); try { @@ -445,12 +458,15 @@ public function snapshotJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new SnapshotJobRequest(); try { @@ -519,12 +535,15 @@ public function updateJobExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new UpdateJobRequest(); try { @@ -551,9 +570,7 @@ public function aggregatedListJobsAsyncTest() // Mock response $nextPageToken = ''; $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; + $jobs = [$jobsElement]; $expectedResponse = new ListJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobs($jobs); diff --git a/Dataflow/tests/Unit/V1beta3/Client/MessagesV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/Client/MessagesV1Beta3ClientTest.php index a7cd94d3371b..a3ea3a41499f 100644 --- a/Dataflow/tests/Unit/V1beta3/Client/MessagesV1Beta3ClientTest.php +++ b/Dataflow/tests/Unit/V1beta3/Client/MessagesV1Beta3ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return MessagesV1Beta3Client */ @@ -72,9 +74,7 @@ public function listJobMessagesTest() // Mock response $nextPageToken = ''; $jobMessagesElement = new JobMessage(); - $jobMessages = [ - $jobMessagesElement, - ]; + $jobMessages = [$jobMessagesElement]; $expectedResponse = new ListJobMessagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobMessages($jobMessages); @@ -104,12 +104,15 @@ public function listJobMessagesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListJobMessagesRequest(); try { @@ -136,9 +139,7 @@ public function listJobMessagesAsyncTest() // Mock response $nextPageToken = ''; $jobMessagesElement = new JobMessage(); - $jobMessages = [ - $jobMessagesElement, - ]; + $jobMessages = [$jobMessagesElement]; $expectedResponse = new ListJobMessagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setJobMessages($jobMessages); diff --git a/Dataflow/tests/Unit/V1beta3/Client/MetricsV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/Client/MetricsV1Beta3ClientTest.php index 31d1d06e3572..b7f89c3c071b 100644 --- a/Dataflow/tests/Unit/V1beta3/Client/MetricsV1Beta3ClientTest.php +++ b/Dataflow/tests/Unit/V1beta3/Client/MetricsV1Beta3ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return MetricsV1Beta3Client */ @@ -77,9 +79,7 @@ public function getJobExecutionDetailsTest() // Mock response $nextPageToken = ''; $stagesElement = new StageSummary(); - $stages = [ - $stagesElement, - ]; + $stages = [$stagesElement]; $expectedResponse = new JobExecutionDetails(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setStages($stages); @@ -109,12 +109,15 @@ public function getJobExecutionDetailsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetJobExecutionDetailsRequest(); try { @@ -163,12 +166,15 @@ public function getJobMetricsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetJobMetricsRequest(); try { @@ -195,9 +201,7 @@ public function getStageExecutionDetailsTest() // Mock response $nextPageToken = ''; $workersElement = new WorkerDetails(); - $workers = [ - $workersElement, - ]; + $workers = [$workersElement]; $expectedResponse = new StageExecutionDetails(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkers($workers); @@ -227,12 +231,15 @@ public function getStageExecutionDetailsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetStageExecutionDetailsRequest(); try { @@ -259,9 +266,7 @@ public function getJobExecutionDetailsAsyncTest() // Mock response $nextPageToken = ''; $stagesElement = new StageSummary(); - $stages = [ - $stagesElement, - ]; + $stages = [$stagesElement]; $expectedResponse = new JobExecutionDetails(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setStages($stages); diff --git a/Dataflow/tests/Unit/V1beta3/Client/SnapshotsV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/Client/SnapshotsV1Beta3ClientTest.php index 03b97b9da8bd..583dab3d687b 100644 --- a/Dataflow/tests/Unit/V1beta3/Client/SnapshotsV1Beta3ClientTest.php +++ b/Dataflow/tests/Unit/V1beta3/Client/SnapshotsV1Beta3ClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return SnapshotsV1Beta3Client */ @@ -97,12 +99,15 @@ public function deleteSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new DeleteSnapshotRequest(); try { @@ -163,12 +168,15 @@ public function getSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetSnapshotRequest(); try { @@ -217,12 +225,15 @@ public function listSnapshotsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListSnapshotsRequest(); try { diff --git a/Dataflow/tests/Unit/V1beta3/Client/TemplatesServiceClientTest.php b/Dataflow/tests/Unit/V1beta3/Client/TemplatesServiceClientTest.php index ac219e68e8b2..b2483aaa49b4 100644 --- a/Dataflow/tests/Unit/V1beta3/Client/TemplatesServiceClientTest.php +++ b/Dataflow/tests/Unit/V1beta3/Client/TemplatesServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return TemplatesServiceClient */ @@ -117,12 +119,15 @@ public function createJobFromTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new CreateJobFromTemplateRequest(); try { @@ -171,12 +176,15 @@ public function getTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetTemplateRequest(); try { @@ -225,12 +233,15 @@ public function launchTemplateExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new LaunchTemplateRequest(); try { diff --git a/Dataflow/tests/Unit/V1beta3/FlexTemplatesServiceClientTest.php b/Dataflow/tests/Unit/V1beta3/FlexTemplatesServiceClientTest.php deleted file mode 100644 index c27ed7b5a75a..000000000000 --- a/Dataflow/tests/Unit/V1beta3/FlexTemplatesServiceClientTest.php +++ /dev/null @@ -1,113 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FlexTemplatesServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FlexTemplatesServiceClient($options); - } - - /** @test */ - public function launchFlexTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LaunchFlexTemplateResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->launchFlexTemplate(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.FlexTemplatesService/LaunchFlexTemplate', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function launchFlexTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->launchFlexTemplate(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataflow/tests/Unit/V1beta3/JobsV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/JobsV1Beta3ClientTest.php deleted file mode 100644 index 04dec0edb04e..000000000000 --- a/Dataflow/tests/Unit/V1beta3/JobsV1Beta3ClientTest.php +++ /dev/null @@ -1,522 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return JobsV1Beta3Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new JobsV1Beta3Client($options); - } - - /** @test */ - public function aggregatedListJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - $response = $gapicClient->aggregatedListJobs(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/AggregatedListJobs', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function aggregatedListJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->aggregatedListJobs(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function checkActiveJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $activeJobsExist = false; - $expectedResponse = new CheckActiveJobsResponse(); - $expectedResponse->setActiveJobsExist($activeJobsExist); - $transport->addResponse($expectedResponse); - $response = $gapicClient->checkActiveJobs(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/CheckActiveJobs', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function checkActiveJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->checkActiveJobs(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $name = 'name3373707'; - $stepsLocation = 'stepsLocation-354969139'; - $replaceJobId2 = 'replaceJobId2-609521029'; - $clientRequestId = 'clientRequestId-1902516801'; - $replacedByJobId = 'replacedByJobId-671370122'; - $location2 = 'location21541837352'; - $createdFromSnapshotId = 'createdFromSnapshotId1520659672'; - $satisfiesPzs = false; - $expectedResponse = new Job(); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setName($name); - $expectedResponse->setStepsLocation($stepsLocation); - $expectedResponse->setReplaceJobId($replaceJobId2); - $expectedResponse->setClientRequestId($clientRequestId); - $expectedResponse->setReplacedByJobId($replacedByJobId); - $expectedResponse->setLocation($location2); - $expectedResponse->setCreatedFromSnapshotId($createdFromSnapshotId); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - $response = $gapicClient->createJob(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/CreateJob', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->createJob(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $name = 'name3373707'; - $stepsLocation = 'stepsLocation-354969139'; - $replaceJobId = 'replaceJobId459700424'; - $clientRequestId = 'clientRequestId-1902516801'; - $replacedByJobId = 'replacedByJobId-671370122'; - $location2 = 'location21541837352'; - $createdFromSnapshotId = 'createdFromSnapshotId1520659672'; - $satisfiesPzs = false; - $expectedResponse = new Job(); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setName($name); - $expectedResponse->setStepsLocation($stepsLocation); - $expectedResponse->setReplaceJobId($replaceJobId); - $expectedResponse->setClientRequestId($clientRequestId); - $expectedResponse->setReplacedByJobId($replacedByJobId); - $expectedResponse->setLocation($location2); - $expectedResponse->setCreatedFromSnapshotId($createdFromSnapshotId); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getJob(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/GetJob', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getJob(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobsElement = new Job(); - $jobs = [ - $jobsElement, - ]; - $expectedResponse = new ListJobsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobs($jobs); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listJobs(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/ListJobs', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listJobs(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function snapshotJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $sourceJobId = 'sourceJobId-16371327'; - $description2 = 'description2568623279'; - $diskSizeBytes = 275393905; - $region = 'region-934795532'; - $expectedResponse = new Snapshot(); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setSourceJobId($sourceJobId); - $expectedResponse->setDescription($description2); - $expectedResponse->setDiskSizeBytes($diskSizeBytes); - $expectedResponse->setRegion($region); - $transport->addResponse($expectedResponse); - $response = $gapicClient->snapshotJob(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/SnapshotJob', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function snapshotJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->snapshotJob(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $name = 'name3373707'; - $stepsLocation = 'stepsLocation-354969139'; - $replaceJobId = 'replaceJobId459700424'; - $clientRequestId = 'clientRequestId-1902516801'; - $replacedByJobId = 'replacedByJobId-671370122'; - $location2 = 'location21541837352'; - $createdFromSnapshotId = 'createdFromSnapshotId1520659672'; - $satisfiesPzs = false; - $expectedResponse = new Job(); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setName($name); - $expectedResponse->setStepsLocation($stepsLocation); - $expectedResponse->setReplaceJobId($replaceJobId); - $expectedResponse->setClientRequestId($clientRequestId); - $expectedResponse->setReplacedByJobId($replacedByJobId); - $expectedResponse->setLocation($location2); - $expectedResponse->setCreatedFromSnapshotId($createdFromSnapshotId); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - $response = $gapicClient->updateJob(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.JobsV1Beta3/UpdateJob', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateJobExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->updateJob(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataflow/tests/Unit/V1beta3/MessagesV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/MessagesV1Beta3ClientTest.php deleted file mode 100644 index e086fe363954..000000000000 --- a/Dataflow/tests/Unit/V1beta3/MessagesV1Beta3ClientTest.php +++ /dev/null @@ -1,124 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MessagesV1Beta3Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MessagesV1Beta3Client($options); - } - - /** @test */ - public function listJobMessagesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $jobMessagesElement = new JobMessage(); - $jobMessages = [ - $jobMessagesElement, - ]; - $expectedResponse = new ListJobMessagesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setJobMessages($jobMessages); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listJobMessages(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getJobMessages()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.MessagesV1Beta3/ListJobMessages', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listJobMessagesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listJobMessages(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataflow/tests/Unit/V1beta3/MetricsV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/MetricsV1Beta3ClientTest.php deleted file mode 100644 index 34dcc385343d..000000000000 --- a/Dataflow/tests/Unit/V1beta3/MetricsV1Beta3ClientTest.php +++ /dev/null @@ -1,241 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return MetricsV1Beta3Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new MetricsV1Beta3Client($options); - } - - /** @test */ - public function getJobExecutionDetailsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $stagesElement = new StageSummary(); - $stages = [ - $stagesElement, - ]; - $expectedResponse = new JobExecutionDetails(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setStages($stages); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getJobExecutionDetails(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getStages()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.MetricsV1Beta3/GetJobExecutionDetails', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobExecutionDetailsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getJobExecutionDetails(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobMetricsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new JobMetrics(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getJobMetrics(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.MetricsV1Beta3/GetJobMetrics', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getJobMetricsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getJobMetrics(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getStageExecutionDetailsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workersElement = new WorkerDetails(); - $workers = [ - $workersElement, - ]; - $expectedResponse = new StageExecutionDetails(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkers($workers); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getStageExecutionDetails(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.MetricsV1Beta3/GetStageExecutionDetails', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getStageExecutionDetailsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getStageExecutionDetails(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataflow/tests/Unit/V1beta3/SnapshotsV1Beta3ClientTest.php b/Dataflow/tests/Unit/V1beta3/SnapshotsV1Beta3ClientTest.php deleted file mode 100644 index 4c65afb809da..000000000000 --- a/Dataflow/tests/Unit/V1beta3/SnapshotsV1Beta3ClientTest.php +++ /dev/null @@ -1,231 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return SnapshotsV1Beta3Client */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new SnapshotsV1Beta3Client($options); - } - - /** @test */ - public function deleteSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new DeleteSnapshotResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->deleteSnapshot(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.SnapshotsV1Beta3/DeleteSnapshot', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteSnapshotExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->deleteSnapshot(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnapshotTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $sourceJobId = 'sourceJobId-16371327'; - $description = 'description-1724546052'; - $diskSizeBytes = 275393905; - $region = 'region-934795532'; - $expectedResponse = new Snapshot(); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setSourceJobId($sourceJobId); - $expectedResponse->setDescription($description); - $expectedResponse->setDiskSizeBytes($diskSizeBytes); - $expectedResponse->setRegion($region); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getSnapshot(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.SnapshotsV1Beta3/GetSnapshot', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getSnapshotExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getSnapshot(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnapshotsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListSnapshotsResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listSnapshots(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.SnapshotsV1Beta3/ListSnapshots', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listSnapshotsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listSnapshots(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/Dataflow/tests/Unit/V1beta3/TemplatesServiceClientTest.php b/Dataflow/tests/Unit/V1beta3/TemplatesServiceClientTest.php deleted file mode 100644 index 65a2566fac88..000000000000 --- a/Dataflow/tests/Unit/V1beta3/TemplatesServiceClientTest.php +++ /dev/null @@ -1,239 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return TemplatesServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new TemplatesServiceClient($options); - } - - /** @test */ - public function createJobFromTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $name = 'name3373707'; - $stepsLocation = 'stepsLocation-354969139'; - $replaceJobId = 'replaceJobId459700424'; - $clientRequestId = 'clientRequestId-1902516801'; - $replacedByJobId = 'replacedByJobId-671370122'; - $location2 = 'location21541837352'; - $createdFromSnapshotId = 'createdFromSnapshotId1520659672'; - $satisfiesPzs = false; - $expectedResponse = new Job(); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setName($name); - $expectedResponse->setStepsLocation($stepsLocation); - $expectedResponse->setReplaceJobId($replaceJobId); - $expectedResponse->setClientRequestId($clientRequestId); - $expectedResponse->setReplacedByJobId($replacedByJobId); - $expectedResponse->setLocation($location2); - $expectedResponse->setCreatedFromSnapshotId($createdFromSnapshotId); - $expectedResponse->setSatisfiesPzs($satisfiesPzs); - $transport->addResponse($expectedResponse); - $response = $gapicClient->createJobFromTemplate(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.TemplatesService/CreateJobFromTemplate', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobFromTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->createJobFromTemplate(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GetTemplateResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getTemplate(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.TemplatesService/GetTemplate', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getTemplate(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function launchTemplateTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new LaunchTemplateResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->launchTemplate(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.dataflow.v1beta3.TemplatesService/LaunchTemplate', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function launchTemplateExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->launchTemplate(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -} From acee4ca65d31710e62b1024673f0ac1af1746b80 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 18 Dec 2024 00:23:14 +0000 Subject: [PATCH 2/2] revert to preview --- .repo-metadata-full.json | 4 ++-- Dataflow/README.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 2033d4be21e9..47293b0e4b2a 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -509,7 +509,7 @@ "Dataflow": { "language": "php", "distribution_name": "google/cloud-dataflow", - "release_level": "stable", + "release_level": "preview", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-dataflow/latest", "library_type": "GAPIC_AUTO", "api_shortname": "dataflow" @@ -1599,4 +1599,4 @@ "library_type": "GAPIC_AUTO", "api_shortname": "workflows" } -} \ No newline at end of file +} diff --git a/Dataflow/README.md b/Dataflow/README.md index abed96bbfff5..9896c2cd6763 100644 --- a/Dataflow/README.md +++ b/Dataflow/README.md @@ -35,8 +35,9 @@ for more information about the debugging tools. ### Version -This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in -any minor or patch releases. We will address issues and requests with the highest priority. +This component is considered beta. As such, it should be expected to be mostly +stable and we're working towards a release candidate. We will address issues +and requests with a higher priority. ### Next Steps