diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json
index 49b3491111d7..a0e864ac4bf1 100644
--- a/.repo-metadata-full.json
+++ b/.repo-metadata-full.json
@@ -552,7 +552,7 @@
"Deploy": {
"language": "php",
"distribution_name": "google/cloud-deploy",
- "release_level": "preview",
+ "release_level": "stable",
"client_documentation": "https://cloud.google.com/php/docs/reference/cloud-deploy/latest",
"library_type": "GAPIC_AUTO",
"api_shortname": "clouddeploy"
diff --git a/Deploy/README.md b/Deploy/README.md
index 754ac32e2ded..4d855f340168 100644
--- a/Deploy/README.md
+++ b/Deploy/README.md
@@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### 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/Deploy/owlbot.py b/Deploy/owlbot.py
index 74abe132d7d4..e0dc2824d259 100644
--- a/Deploy/owlbot.py
+++ b/Deploy/owlbot.py
@@ -1,4 +1,4 @@
-# Copyright 2021 Google LLC
+# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -30,13 +30,7 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)
-php.owlbot_main(
- src=src,
- dest=dest,
- copy_excludes=[
- src / "**/[A-Z]*_*.php"
- ]
-)
+php.owlbot_main(src=src, dest=dest)
# remove class_alias code
s.replace(
@@ -47,26 +41,6 @@
+ "\n",
'')
-
-### [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 $""")
-
-### [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)"
-)
-
# format generated clients
subprocess.run([
'npm',
@@ -75,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/Deploy/src/V1/AbandonReleaseRequest.php b/Deploy/src/V1/AbandonReleaseRequest.php
index 06ff87a323c3..0b9a4e24b06f 100644
--- a/Deploy/src/V1/AbandonReleaseRequest.php
+++ b/Deploy/src/V1/AbandonReleaseRequest.php
@@ -21,7 +21,7 @@ class AbandonReleaseRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the Release. Format is
diff --git a/Deploy/src/V1/AdvanceChildRolloutJobRun.php b/Deploy/src/V1/AdvanceChildRolloutJobRun.php
index c2ddce830a12..b864bc78b9ed 100644
--- a/Deploy/src/V1/AdvanceChildRolloutJobRun.php
+++ b/Deploy/src/V1/AdvanceChildRolloutJobRun.php
@@ -22,13 +22,13 @@ class AdvanceChildRolloutJobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Output only. the ID of the ChildRollout's Phase.
*
* Generated from protobuf field string rollout_phase_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout_phase_id = '';
+ protected $rollout_phase_id = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/AdvanceRolloutOperation.php b/Deploy/src/V1/AdvanceRolloutOperation.php
index dc15bae113da..8c8cd04062da 100644
--- a/Deploy/src/V1/AdvanceRolloutOperation.php
+++ b/Deploy/src/V1/AdvanceRolloutOperation.php
@@ -20,25 +20,25 @@ class AdvanceRolloutOperation extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string source_phase = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $source_phase = '';
+ protected $source_phase = '';
/**
* Output only. How long the operation will be paused.
*
* Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $wait = null;
+ protected $wait = null;
/**
* Output only. The name of the rollout that initiates the `AutomationRun`.
*
* Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Output only. The phase the rollout will be advanced to.
*
* Generated from protobuf field string destination_phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $destination_phase = '';
+ protected $destination_phase = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/AdvanceRolloutRequest.php b/Deploy/src/V1/AdvanceRolloutRequest.php
index 9631871c44e8..f8c39a9f3dba 100644
--- a/Deploy/src/V1/AdvanceRolloutRequest.php
+++ b/Deploy/src/V1/AdvanceRolloutRequest.php
@@ -21,13 +21,13 @@ class AdvanceRolloutRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Required. The phase ID to advance the `Rollout` to.
*
* Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $phase_id = '';
+ protected $phase_id = '';
/**
* @param string $name Required. Name of the Rollout. Format is
diff --git a/Deploy/src/V1/AdvanceRolloutRule.php b/Deploy/src/V1/AdvanceRolloutRule.php
index 0d5e07e21571..798428be12f8 100644
--- a/Deploy/src/V1/AdvanceRolloutRule.php
+++ b/Deploy/src/V1/AdvanceRolloutRule.php
@@ -23,7 +23,7 @@ class AdvanceRolloutRule extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $id = '';
+ protected $id = '';
/**
* Optional. Proceeds only after phase name matched any one in the list.
* This value must consist of lower-case letters, numbers, and hyphens,
@@ -39,13 +39,13 @@ class AdvanceRolloutRule extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Duration wait = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $wait = null;
+ protected $wait = null;
/**
* Output only. Information around the state of the Automation rule.
*
* Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $condition = null;
+ protected $condition = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/AnthosCluster.php b/Deploy/src/V1/AnthosCluster.php
index fe6579e6d720..4a94f019e63a 100644
--- a/Deploy/src/V1/AnthosCluster.php
+++ b/Deploy/src/V1/AnthosCluster.php
@@ -22,7 +22,7 @@ class AnthosCluster extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string membership = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
*/
- private $membership = '';
+ protected $membership = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/ApproveRolloutRequest.php b/Deploy/src/V1/ApproveRolloutRequest.php
index 7758dadfa7c7..4f881df0b1c2 100644
--- a/Deploy/src/V1/ApproveRolloutRequest.php
+++ b/Deploy/src/V1/ApproveRolloutRequest.php
@@ -21,13 +21,13 @@ class ApproveRolloutRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Required. True = approve; false = reject
*
* Generated from protobuf field bool approved = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $approved = false;
+ protected $approved = false;
/**
* @param string $name Required. Name of the Rollout. Format is
diff --git a/Deploy/src/V1/Automation.php b/Deploy/src/V1/Automation.php
index ddc39053eba6..443645ba2bbd 100644
--- a/Deploy/src/V1/Automation.php
+++ b/Deploy/src/V1/Automation.php
@@ -26,31 +26,31 @@ class Automation extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Unique identifier of the `Automation`.
*
* Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Optional. Description of the `Automation`. Max length is 255 characters.
*
* Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $description = '';
+ protected $description = '';
/**
* Output only. Time at which the automation was created.
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Time at which the automation was updated.
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Optional. User annotations. These attributes can only be set and used by
* the user, and not by Cloud Deploy. Annotations must meet the following
@@ -93,26 +93,26 @@ class Automation extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
/**
* Optional. When Suspended, automation is deactivated from execution.
*
* Generated from protobuf field bool suspended = 9 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $suspended = false;
+ protected $suspended = false;
/**
* Required. Email address of the user-managed IAM service account that
* creates Cloud Deploy release and rollout resources.
*
* Generated from protobuf field string service_account = 10 [(.google.api.field_behavior) = REQUIRED];
*/
- private $service_account = '';
+ protected $service_account = '';
/**
* Required. Selected resources to which the automation will be applied.
*
* Generated from protobuf field .google.cloud.deploy.v1.AutomationResourceSelector selector = 11 [(.google.api.field_behavior) = REQUIRED];
*/
- private $selector = null;
+ protected $selector = null;
/**
* Required. List of Automation rules associated with the Automation resource.
* Must have at least one rule and limited to 250 rules per Delivery Pipeline.
diff --git a/Deploy/src/V1/AutomationEvent.php b/Deploy/src/V1/AutomationEvent.php
index 78bb08011c48..b12f4851332d 100644
--- a/Deploy/src/V1/AutomationEvent.php
+++ b/Deploy/src/V1/AutomationEvent.php
@@ -22,25 +22,25 @@ class AutomationEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* The name of the `AutomationRun`.
*
* Generated from protobuf field string automation = 2;
*/
- private $automation = '';
+ protected $automation = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 3;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 4;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/AutomationRolloutMetadata.php b/Deploy/src/V1/AutomationRolloutMetadata.php
index 0854ad8aed52..94653278f9de 100644
--- a/Deploy/src/V1/AutomationRolloutMetadata.php
+++ b/Deploy/src/V1/AutomationRolloutMetadata.php
@@ -22,7 +22,7 @@ class AutomationRolloutMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string promote_automation_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $promote_automation_run = '';
+ protected $promote_automation_run = '';
/**
* Output only. The IDs of the AutomationRuns initiated by an advance rollout
* rule.
diff --git a/Deploy/src/V1/AutomationRuleCondition.php b/Deploy/src/V1/AutomationRuleCondition.php
index 5a291f07751e..2dac2539cdf3 100644
--- a/Deploy/src/V1/AutomationRuleCondition.php
+++ b/Deploy/src/V1/AutomationRuleCondition.php
@@ -21,7 +21,7 @@ class AutomationRuleCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $targets_present_condition = null;
+ protected $targets_present_condition = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/AutomationRun.php b/Deploy/src/V1/AutomationRun.php
index fadd5c720cd9..3db70ad3d274 100644
--- a/Deploy/src/V1/AutomationRun.php
+++ b/Deploy/src/V1/AutomationRun.php
@@ -23,19 +23,19 @@ class AutomationRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Time at which the `AutomationRun` was created.
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Time at which the automationRun was updated.
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Output only. The weak etag of the `AutomationRun` resource.
* This checksum is computed by the server based on the value of other
@@ -44,21 +44,21 @@ class AutomationRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $etag = '';
+ protected $etag = '';
/**
* Output only. Email address of the user-managed IAM service account that
* performs the operations against Cloud Deploy resources.
*
* Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $service_account = '';
+ protected $service_account = '';
/**
* Output only. Snapshot of the Automation taken at AutomationRun creation
* time.
*
* Generated from protobuf field .google.cloud.deploy.v1.Automation automation_snapshot = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $automation_snapshot = null;
+ protected $automation_snapshot = null;
/**
* Output only. The ID of the target that represents the promotion stage that
* initiates the `AutomationRun`. The value of this field is the last segment
@@ -66,46 +66,46 @@ class AutomationRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string target_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Output only. Current state of the `AutomationRun`.
*
* Generated from protobuf field .google.cloud.deploy.v1.AutomationRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. Explains the current state of the `AutomationRun`. Present
* only when an explanation is needed.
*
* Generated from protobuf field string state_description = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state_description = '';
+ protected $state_description = '';
/**
* Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
* after 14 days from its creation date.
*
* Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $expire_time = null;
+ protected $expire_time = null;
/**
* Output only. The ID of the automation rule that initiated the operation.
*
* Generated from protobuf field string rule_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rule_id = '';
+ protected $rule_id = '';
/**
* Output only. The ID of the automation that initiated the operation.
*
* Generated from protobuf field string automation_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $automation_id = '';
+ protected $automation_id = '';
/**
* Output only. Earliest time the `AutomationRun` will attempt to resume.
* Wait-time is configured by `wait` in automation rule.
*
* Generated from protobuf field .google.protobuf.Timestamp wait_until_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $wait_until_time = null;
+ protected $wait_until_time = null;
protected $operation;
/**
diff --git a/Deploy/src/V1/AutomationRunEvent.php b/Deploy/src/V1/AutomationRunEvent.php
index c81ff9cee813..409f23c5f943 100644
--- a/Deploy/src/V1/AutomationRunEvent.php
+++ b/Deploy/src/V1/AutomationRunEvent.php
@@ -22,43 +22,43 @@ class AutomationRunEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* The name of the `AutomationRun`.
*
* Generated from protobuf field string automation_run = 2;
*/
- private $automation_run = '';
+ protected $automation_run = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 3;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* Identifier of the `Automation`.
*
* Generated from protobuf field string automation_id = 4;
*/
- private $automation_id = '';
+ protected $automation_id = '';
/**
* Identifier of the `Automation` rule.
*
* Generated from protobuf field string rule_id = 5;
*/
- private $rule_id = '';
+ protected $rule_id = '';
/**
* ID of the `Target` to which the `AutomationRun` is created.
*
* Generated from protobuf field string destination_target_id = 6;
*/
- private $destination_target_id = '';
+ protected $destination_target_id = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 7;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/BuildArtifact.php b/Deploy/src/V1/BuildArtifact.php
index 9bccc560123b..23cd5da0a754 100644
--- a/Deploy/src/V1/BuildArtifact.php
+++ b/Deploy/src/V1/BuildArtifact.php
@@ -20,7 +20,7 @@ class BuildArtifact extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string image = 3;
*/
- private $image = '';
+ protected $image = '';
/**
* Image tag to use. This will generally be the full path to an image, such
* as "gcr.io/my-project/busybox:1.2.3" or
@@ -28,7 +28,7 @@ class BuildArtifact extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string tag = 2;
*/
- private $tag = '';
+ protected $tag = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/Canary.php b/Deploy/src/V1/Canary.php
index ee4070befe3d..929faf223233 100644
--- a/Deploy/src/V1/Canary.php
+++ b/Deploy/src/V1/Canary.php
@@ -22,7 +22,7 @@ class Canary extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.RuntimeConfig runtime_config = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $runtime_config = null;
+ protected $runtime_config = null;
protected $mode;
/**
diff --git a/Deploy/src/V1/CanaryDeployment.php b/Deploy/src/V1/CanaryDeployment.php
index 43798d288ba7..7d2b36b630b6 100644
--- a/Deploy/src/V1/CanaryDeployment.php
+++ b/Deploy/src/V1/CanaryDeployment.php
@@ -28,21 +28,21 @@ class CanaryDeployment extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool verify = 2;
*/
- private $verify = false;
+ protected $verify = false;
/**
* Optional. Configuration for the predeploy job of the first phase. If this
* is not configured, there will be no predeploy job for this phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $predeploy = null;
+ protected $predeploy = null;
/**
* Optional. Configuration for the postdeploy job of the last phase. If this
* is not configured, there will be no postdeploy job for this phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $postdeploy = null;
+ protected $postdeploy = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/CancelAutomationRunRequest.php b/Deploy/src/V1/CancelAutomationRunRequest.php
index f5f914a02594..9b97433df290 100644
--- a/Deploy/src/V1/CancelAutomationRunRequest.php
+++ b/Deploy/src/V1/CancelAutomationRunRequest.php
@@ -21,7 +21,7 @@ class CancelAutomationRunRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `AutomationRun`. Format is
diff --git a/Deploy/src/V1/CancelRolloutRequest.php b/Deploy/src/V1/CancelRolloutRequest.php
index b8d2ff53ad15..3ae1d6f52a6f 100644
--- a/Deploy/src/V1/CancelRolloutRequest.php
+++ b/Deploy/src/V1/CancelRolloutRequest.php
@@ -21,7 +21,7 @@ class CancelRolloutRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the Rollout. Format is
diff --git a/Deploy/src/V1/Client/CloudDeployClient.php b/Deploy/src/V1/Client/CloudDeployClient.php
index 4c8585ac7303..6bb7d99f935d 100644
--- a/Deploy/src/V1/Client/CloudDeployClient.php
+++ b/Deploy/src/V1/Client/CloudDeployClient.php
@@ -1,6 +1,6 @@
descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];
+ $options = isset($this->descriptors[$methodName]['longRunning'])
+ ? $this->descriptors[$methodName]['longRunning']
+ : [];
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
$operation->reload();
return $operation;
}
+ /**
+ * Create the default operation client for the service.
+ *
+ * @param array $options ClientOptions for the client.
+ *
+ * @return OperationsClient
+ */
+ private function createOperationsClient(array $options)
+ {
+ // Unset client-specific configuration options
+ unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
+
+ if (isset($options['operationsClient'])) {
+ return $options['operationsClient'];
+ }
+
+ return new OperationsClient($options);
+ }
+
/**
* Formats a string containing the fully-qualified path to represent a automation
* resource.
@@ -252,8 +271,12 @@ public function resumeOperation($operationName, $methodName = null)
*
* @return string The formatted automation resource.
*/
- public static function automationName(string $project, string $location, string $deliveryPipeline, string $automation): string
- {
+ public static function automationName(
+ string $project,
+ string $location,
+ string $deliveryPipeline,
+ string $automation
+ ): string {
return self::getPathTemplate('automation')->render([
'project' => $project,
'location' => $location,
@@ -273,8 +296,12 @@ public static function automationName(string $project, string $location, string
*
* @return string The formatted automation_run resource.
*/
- public static function automationRunName(string $project, string $location, string $deliveryPipeline, string $automationRun): string
- {
+ public static function automationRunName(
+ string $project,
+ string $location,
+ string $deliveryPipeline,
+ string $automationRun
+ ): string {
return self::getPathTemplate('automationRun')->render([
'project' => $project,
'location' => $location,
@@ -408,8 +435,14 @@ public static function jobName(string $project, string $location, string $job):
*
* @return string The formatted job_run resource.
*/
- public static function jobRunName(string $project, string $location, string $deliveryPipeline, string $release, string $rollout, string $jobRun): string
- {
+ public static function jobRunName(
+ string $project,
+ string $location,
+ string $deliveryPipeline,
+ string $release,
+ string $rollout,
+ string $jobRun
+ ): string {
return self::getPathTemplate('jobRun')->render([
'project' => $project,
'location' => $location,
@@ -467,8 +500,12 @@ public static function membershipName(string $project, string $location, string
*
* @return string The formatted release resource.
*/
- public static function releaseName(string $project, string $location, string $deliveryPipeline, string $release): string
- {
+ public static function releaseName(
+ string $project,
+ string $location,
+ string $deliveryPipeline,
+ string $release
+ ): string {
return self::getPathTemplate('release')->render([
'project' => $project,
'location' => $location,
@@ -488,8 +525,12 @@ public static function releaseName(string $project, string $location, string $de
*
* @return string The formatted repository resource.
*/
- public static function repositoryName(string $project, string $location, string $connection, string $repository): string
- {
+ public static function repositoryName(
+ string $project,
+ string $location,
+ string $connection,
+ string $repository
+ ): string {
return self::getPathTemplate('repository')->render([
'project' => $project,
'location' => $location,
@@ -510,8 +551,13 @@ public static function repositoryName(string $project, string $location, string
*
* @return string The formatted rollout resource.
*/
- public static function rolloutName(string $project, string $location, string $deliveryPipeline, string $release, string $rollout): string
- {
+ public static function rolloutName(
+ string $project,
+ string $location,
+ string $deliveryPipeline,
+ string $release,
+ string $rollout
+ ): string {
return self::getPathTemplate('rollout')->render([
'project' => $project,
'location' => $location,
@@ -792,8 +838,10 @@ public function approveRollout(ApproveRolloutRequest $request, array $callOption
*
* @throws ApiException Thrown if the API call fails.
*/
- public function cancelAutomationRun(CancelAutomationRunRequest $request, array $callOptions = []): CancelAutomationRunResponse
- {
+ public function cancelAutomationRun(
+ CancelAutomationRunRequest $request,
+ array $callOptions = []
+ ): CancelAutomationRunResponse {
return $this->startApiCall('CancelAutomationRun', $request, $callOptions)->wait();
}
@@ -870,8 +918,10 @@ public function createAutomation(CreateAutomationRequest $request, array $callOp
*
* @throws ApiException Thrown if the API call fails.
*/
- public function createCustomTargetType(CreateCustomTargetTypeRequest $request, array $callOptions = []): OperationResponse
- {
+ public function createCustomTargetType(
+ CreateCustomTargetTypeRequest $request,
+ array $callOptions = []
+ ): OperationResponse {
return $this->startApiCall('CreateCustomTargetType', $request, $callOptions)->wait();
}
@@ -896,8 +946,10 @@ public function createCustomTargetType(CreateCustomTargetTypeRequest $request, a
*
* @throws ApiException Thrown if the API call fails.
*/
- public function createDeliveryPipeline(CreateDeliveryPipelineRequest $request, array $callOptions = []): OperationResponse
- {
+ public function createDeliveryPipeline(
+ CreateDeliveryPipelineRequest $request,
+ array $callOptions = []
+ ): OperationResponse {
return $this->startApiCall('CreateDeliveryPipeline', $request, $callOptions)->wait();
}
@@ -1026,8 +1078,10 @@ public function deleteAutomation(DeleteAutomationRequest $request, array $callOp
*
* @throws ApiException Thrown if the API call fails.
*/
- public function deleteCustomTargetType(DeleteCustomTargetTypeRequest $request, array $callOptions = []): OperationResponse
- {
+ public function deleteCustomTargetType(
+ DeleteCustomTargetTypeRequest $request,
+ array $callOptions = []
+ ): OperationResponse {
return $this->startApiCall('DeleteCustomTargetType', $request, $callOptions)->wait();
}
@@ -1052,8 +1106,10 @@ public function deleteCustomTargetType(DeleteCustomTargetTypeRequest $request, a
*
* @throws ApiException Thrown if the API call fails.
*/
- public function deleteDeliveryPipeline(DeleteDeliveryPipelineRequest $request, array $callOptions = []): OperationResponse
- {
+ public function deleteDeliveryPipeline(
+ DeleteDeliveryPipelineRequest $request,
+ array $callOptions = []
+ ): OperationResponse {
return $this->startApiCall('DeleteDeliveryPipeline', $request, $callOptions)->wait();
}
@@ -1416,8 +1472,10 @@ public function listAutomations(ListAutomationsRequest $request, array $callOpti
*
* @throws ApiException Thrown if the API call fails.
*/
- public function listCustomTargetTypes(ListCustomTargetTypesRequest $request, array $callOptions = []): PagedListResponse
- {
+ public function listCustomTargetTypes(
+ ListCustomTargetTypesRequest $request,
+ array $callOptions = []
+ ): PagedListResponse {
return $this->startApiCall('ListCustomTargetTypes', $request, $callOptions);
}
@@ -1442,8 +1500,10 @@ public function listCustomTargetTypes(ListCustomTargetTypesRequest $request, arr
*
* @throws ApiException Thrown if the API call fails.
*/
- public function listDeliveryPipelines(ListDeliveryPipelinesRequest $request, array $callOptions = []): PagedListResponse
- {
+ public function listDeliveryPipelines(
+ ListDeliveryPipelinesRequest $request,
+ array $callOptions = []
+ ): PagedListResponse {
return $this->startApiCall('ListDeliveryPipelines', $request, $callOptions);
}
@@ -1676,8 +1736,10 @@ public function updateAutomation(UpdateAutomationRequest $request, array $callOp
*
* @throws ApiException Thrown if the API call fails.
*/
- public function updateCustomTargetType(UpdateCustomTargetTypeRequest $request, array $callOptions = []): OperationResponse
- {
+ public function updateCustomTargetType(
+ UpdateCustomTargetTypeRequest $request,
+ array $callOptions = []
+ ): OperationResponse {
return $this->startApiCall('UpdateCustomTargetType', $request, $callOptions)->wait();
}
@@ -1702,8 +1764,10 @@ public function updateCustomTargetType(UpdateCustomTargetTypeRequest $request, a
*
* @throws ApiException Thrown if the API call fails.
*/
- public function updateDeliveryPipeline(UpdateDeliveryPipelineRequest $request, array $callOptions = []): OperationResponse
- {
+ public function updateDeliveryPipeline(
+ UpdateDeliveryPipelineRequest $request,
+ array $callOptions = []
+ ): OperationResponse {
return $this->startApiCall('UpdateDeliveryPipeline', $request, $callOptions)->wait();
}
@@ -1869,8 +1933,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions =
*
* @throws ApiException Thrown if the API call fails.
*/
- public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse
- {
+ public function testIamPermissions(
+ TestIamPermissionsRequest $request,
+ array $callOptions = []
+ ): TestIamPermissionsResponse {
return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait();
}
}
diff --git a/Deploy/src/V1/CloudDeployClient.php b/Deploy/src/V1/CloudDeployClient.php
deleted file mode 100644
index 36d1b9c3e597..000000000000
--- a/Deploy/src/V1/CloudDeployClient.php
+++ /dev/null
@@ -1,34 +0,0 @@
-_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListDeliveryPipelines',
- $argument,
- ['\Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Gets details of a single DeliveryPipeline.
- * @param \Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function GetDeliveryPipeline(\Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetDeliveryPipeline',
- $argument,
- ['\Google\Cloud\Deploy\V1\DeliveryPipeline', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Creates a new DeliveryPipeline in a given project and location.
- * @param \Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function CreateDeliveryPipeline(\Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateDeliveryPipeline',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Updates the parameters of a single DeliveryPipeline.
- * @param \Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function UpdateDeliveryPipeline(\Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/UpdateDeliveryPipeline',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Deletes a single DeliveryPipeline.
- * @param \Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function DeleteDeliveryPipeline(\Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Lists Targets in a given project and location.
- * @param \Google\Cloud\Deploy\V1\ListTargetsRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function ListTargets(\Google\Cloud\Deploy\V1\ListTargetsRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListTargets',
- $argument,
- ['\Google\Cloud\Deploy\V1\ListTargetsResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Gets details of a single Target.
- * @param \Google\Cloud\Deploy\V1\GetTargetRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function GetTarget(\Google\Cloud\Deploy\V1\GetTargetRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetTarget',
- $argument,
- ['\Google\Cloud\Deploy\V1\Target', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Creates a new Target in a given project and location.
- * @param \Google\Cloud\Deploy\V1\CreateTargetRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function CreateTarget(\Google\Cloud\Deploy\V1\CreateTargetRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateTarget',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Updates the parameters of a single Target.
- * @param \Google\Cloud\Deploy\V1\UpdateTargetRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function UpdateTarget(\Google\Cloud\Deploy\V1\UpdateTargetRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/UpdateTarget',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Deletes a single Target.
- * @param \Google\Cloud\Deploy\V1\DeleteTargetRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function DeleteTarget(\Google\Cloud\Deploy\V1\DeleteTargetRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Lists Releases in a given project and location.
- * @param \Google\Cloud\Deploy\V1\ListReleasesRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function ListReleases(\Google\Cloud\Deploy\V1\ListReleasesRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListReleases',
- $argument,
- ['\Google\Cloud\Deploy\V1\ListReleasesResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Gets details of a single Release.
- * @param \Google\Cloud\Deploy\V1\GetReleaseRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function GetRelease(\Google\Cloud\Deploy\V1\GetReleaseRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetRelease',
- $argument,
- ['\Google\Cloud\Deploy\V1\Release', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Creates a new Release in a given project and location.
- * @param \Google\Cloud\Deploy\V1\CreateReleaseRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function CreateRelease(\Google\Cloud\Deploy\V1\CreateReleaseRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateRelease',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Abandons a Release in the Delivery Pipeline.
- * @param \Google\Cloud\Deploy\V1\AbandonReleaseRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function AbandonRelease(\Google\Cloud\Deploy\V1\AbandonReleaseRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/AbandonRelease',
- $argument,
- ['\Google\Cloud\Deploy\V1\AbandonReleaseResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Approves a Rollout.
- * @param \Google\Cloud\Deploy\V1\ApproveRolloutRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function ApproveRollout(\Google\Cloud\Deploy\V1\ApproveRolloutRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ApproveRollout',
- $argument,
- ['\Google\Cloud\Deploy\V1\ApproveRolloutResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Advances a Rollout in a given project and location.
- * @param \Google\Cloud\Deploy\V1\AdvanceRolloutRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function AdvanceRollout(\Google\Cloud\Deploy\V1\AdvanceRolloutRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/AdvanceRollout',
- $argument,
- ['\Google\Cloud\Deploy\V1\AdvanceRolloutResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Cancels a Rollout in a given project and location.
- * @param \Google\Cloud\Deploy\V1\CancelRolloutRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function CancelRollout(\Google\Cloud\Deploy\V1\CancelRolloutRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CancelRollout',
- $argument,
- ['\Google\Cloud\Deploy\V1\CancelRolloutResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Lists Rollouts in a given project and location.
- * @param \Google\Cloud\Deploy\V1\ListRolloutsRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function ListRollouts(\Google\Cloud\Deploy\V1\ListRolloutsRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListRollouts',
- $argument,
- ['\Google\Cloud\Deploy\V1\ListRolloutsResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Gets details of a single Rollout.
- * @param \Google\Cloud\Deploy\V1\GetRolloutRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function GetRollout(\Google\Cloud\Deploy\V1\GetRolloutRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetRollout',
- $argument,
- ['\Google\Cloud\Deploy\V1\Rollout', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Creates a new Rollout in a given project and location.
- * @param \Google\Cloud\Deploy\V1\CreateRolloutRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function CreateRollout(\Google\Cloud\Deploy\V1\CreateRolloutRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateRollout',
- $argument,
- ['\Google\LongRunning\Operation', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Ignores the specified Job in a Rollout.
- * @param \Google\Cloud\Deploy\V1\IgnoreJobRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function IgnoreJob(\Google\Cloud\Deploy\V1\IgnoreJobRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/IgnoreJob',
- $argument,
- ['\Google\Cloud\Deploy\V1\IgnoreJobResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Retries the specified Job in a Rollout.
- * @param \Google\Cloud\Deploy\V1\RetryJobRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function RetryJob(\Google\Cloud\Deploy\V1\RetryJobRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/RetryJob',
- $argument,
- ['\Google\Cloud\Deploy\V1\RetryJobResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Lists JobRuns in a given project and location.
- * @param \Google\Cloud\Deploy\V1\ListJobRunsRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function ListJobRuns(\Google\Cloud\Deploy\V1\ListJobRunsRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListJobRuns',
- $argument,
- ['\Google\Cloud\Deploy\V1\ListJobRunsResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Gets details of a single JobRun.
- * @param \Google\Cloud\Deploy\V1\GetJobRunRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function GetJobRun(\Google\Cloud\Deploy\V1\GetJobRunRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetJobRun',
- $argument,
- ['\Google\Cloud\Deploy\V1\JobRun', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Terminates a Job Run in a given project and location.
- * @param \Google\Cloud\Deploy\V1\TerminateJobRunRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function TerminateJobRun(\Google\Cloud\Deploy\V1\TerminateJobRunRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/TerminateJobRun',
- $argument,
- ['\Google\Cloud\Deploy\V1\TerminateJobRunResponse', 'decode'],
- $metadata, $options);
- }
-
- /**
- * Gets the configuration for a location.
- * @param \Google\Cloud\Deploy\V1\GetConfigRequest $argument input argument
- * @param array $metadata metadata
- * @param array $options call options
- * @return \Grpc\UnaryCall
- */
- public function GetConfig(\Google\Cloud\Deploy\V1\GetConfigRequest $argument,
- $metadata = [], $options = []) {
- return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetConfig',
- $argument,
- ['\Google\Cloud\Deploy\V1\Config', 'decode'],
- $metadata, $options);
- }
-
-}
diff --git a/Deploy/src/V1/CloudRunConfig.php b/Deploy/src/V1/CloudRunConfig.php
index 9af7174bba20..030fbfbdf261 100644
--- a/Deploy/src/V1/CloudRunConfig.php
+++ b/Deploy/src/V1/CloudRunConfig.php
@@ -23,7 +23,7 @@ class CloudRunConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool automatic_traffic_control = 1;
*/
- private $automatic_traffic_control = false;
+ protected $automatic_traffic_control = false;
/**
* Optional. A list of tags that are added to the canary revision while the
* canary phase is in progress.
diff --git a/Deploy/src/V1/CloudRunLocation.php b/Deploy/src/V1/CloudRunLocation.php
index b94327544b9e..ff0ebad3a710 100644
--- a/Deploy/src/V1/CloudRunLocation.php
+++ b/Deploy/src/V1/CloudRunLocation.php
@@ -21,7 +21,7 @@ class CloudRunLocation extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $location = '';
+ protected $location = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/CloudRunMetadata.php b/Deploy/src/V1/CloudRunMetadata.php
index a47e5956a683..ce57bad75b8c 100644
--- a/Deploy/src/V1/CloudRunMetadata.php
+++ b/Deploy/src/V1/CloudRunMetadata.php
@@ -22,7 +22,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $service = '';
+ protected $service = '';
/**
* Output only. The Cloud Run Service urls that are associated with a
* `Rollout`.
@@ -35,7 +35,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string revision = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $revision = '';
+ protected $revision = '';
/**
* Output only. The name of the Cloud Run job that is associated with a
* `Rollout`. Format is
@@ -43,7 +43,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $job = '';
+ protected $job = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/CloudRunRenderMetadata.php b/Deploy/src/V1/CloudRunRenderMetadata.php
index 6471fb97e238..8695f4611f63 100644
--- a/Deploy/src/V1/CloudRunRenderMetadata.php
+++ b/Deploy/src/V1/CloudRunRenderMetadata.php
@@ -22,7 +22,7 @@ class CloudRunRenderMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $service = '';
+ protected $service = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/Config.php b/Deploy/src/V1/Config.php
index 578e07f66e11..d3401ecb99a3 100644
--- a/Deploy/src/V1/Config.php
+++ b/Deploy/src/V1/Config.php
@@ -20,7 +20,7 @@ class Config extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1;
*/
- private $name = '';
+ protected $name = '';
/**
* All supported versions of Skaffold.
*
@@ -33,7 +33,7 @@ class Config extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string default_skaffold_version = 3;
*/
- private $default_skaffold_version = '';
+ protected $default_skaffold_version = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/CreateAutomationRequest.php b/Deploy/src/V1/CreateAutomationRequest.php
index b6e89528f70f..be5a7c0be40e 100644
--- a/Deploy/src/V1/CreateAutomationRequest.php
+++ b/Deploy/src/V1/CreateAutomationRequest.php
@@ -22,19 +22,19 @@ class CreateAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Required. ID of the `Automation`.
*
* Generated from protobuf field string automation_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $automation_id = '';
+ protected $automation_id = '';
/**
* Required. The `Automation` to create.
*
* Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $automation = null;
+ protected $automation = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -50,14 +50,14 @@ class CreateAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param string $parent Required. The parent collection in which the `Automation` should be
diff --git a/Deploy/src/V1/CreateChildRolloutJobRun.php b/Deploy/src/V1/CreateChildRolloutJobRun.php
index b62a3bb82522..2207026b617e 100644
--- a/Deploy/src/V1/CreateChildRolloutJobRun.php
+++ b/Deploy/src/V1/CreateChildRolloutJobRun.php
@@ -22,13 +22,13 @@ class CreateChildRolloutJobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Output only. The ID of the childRollout Phase initiated by this JobRun.
*
* Generated from protobuf field string rollout_phase_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout_phase_id = '';
+ protected $rollout_phase_id = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/CreateCustomTargetTypeRequest.php b/Deploy/src/V1/CreateCustomTargetTypeRequest.php
index ab0600295264..8a960ab99c5c 100644
--- a/Deploy/src/V1/CreateCustomTargetTypeRequest.php
+++ b/Deploy/src/V1/CreateCustomTargetTypeRequest.php
@@ -22,19 +22,19 @@ class CreateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Required. ID of the `CustomTargetType`.
*
* Generated from protobuf field string custom_target_type_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $custom_target_type_id = '';
+ protected $custom_target_type_id = '';
/**
* Required. The `CustomTargetType` to create.
*
* Generated from protobuf field .google.cloud.deploy.v1.CustomTargetType custom_target_type = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $custom_target_type = null;
+ protected $custom_target_type = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -50,14 +50,14 @@ class CreateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param string $parent Required. The parent collection in which the `CustomTargetType` should be
diff --git a/Deploy/src/V1/CreateDeliveryPipelineRequest.php b/Deploy/src/V1/CreateDeliveryPipelineRequest.php
index 5cfb560430c1..48852f0c48dd 100644
--- a/Deploy/src/V1/CreateDeliveryPipelineRequest.php
+++ b/Deploy/src/V1/CreateDeliveryPipelineRequest.php
@@ -22,19 +22,19 @@ class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Required. ID of the `DeliveryPipeline`.
*
* Generated from protobuf field string delivery_pipeline_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $delivery_pipeline_id = '';
+ protected $delivery_pipeline_id = '';
/**
* Required. The `DeliveryPipeline` to create.
*
* Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $delivery_pipeline = null;
+ protected $delivery_pipeline = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -50,14 +50,14 @@ class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be
diff --git a/Deploy/src/V1/CreateReleaseRequest.php b/Deploy/src/V1/CreateReleaseRequest.php
index 6d7f011c0768..538162251d06 100644
--- a/Deploy/src/V1/CreateReleaseRequest.php
+++ b/Deploy/src/V1/CreateReleaseRequest.php
@@ -22,19 +22,19 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Required. ID of the `Release`.
*
* Generated from protobuf field string release_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $release_id = '';
+ protected $release_id = '';
/**
* Required. The `Release` to create.
*
* Generated from protobuf field .google.cloud.deploy.v1.Release release = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $release = null;
+ protected $release = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -50,14 +50,14 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param string $parent Required. The parent collection in which the `Release` should be created.
diff --git a/Deploy/src/V1/CreateRolloutRequest.php b/Deploy/src/V1/CreateRolloutRequest.php
index 470438383afa..49dc433f36a2 100644
--- a/Deploy/src/V1/CreateRolloutRequest.php
+++ b/Deploy/src/V1/CreateRolloutRequest.php
@@ -22,19 +22,19 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Required. ID of the `Rollout`.
*
* Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $rollout_id = '';
+ protected $rollout_id = '';
/**
* Required. The `Rollout` to create.
*
* Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $rollout = null;
+ protected $rollout = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -50,21 +50,21 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
* will start at the first phase.
*
* Generated from protobuf field string starting_phase_id = 7 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $starting_phase_id = '';
+ protected $starting_phase_id = '';
/**
* @param string $parent Required. The parent collection in which the `Rollout` should be created.
diff --git a/Deploy/src/V1/CreateTargetRequest.php b/Deploy/src/V1/CreateTargetRequest.php
index 043c9785a1eb..9c666d2eca4f 100644
--- a/Deploy/src/V1/CreateTargetRequest.php
+++ b/Deploy/src/V1/CreateTargetRequest.php
@@ -22,19 +22,19 @@ class CreateTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Required. ID of the `Target`.
*
* Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Required. The `Target` to create.
*
* Generated from protobuf field .google.cloud.deploy.v1.Target target = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $target = null;
+ protected $target = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -50,14 +50,14 @@ class CreateTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param string $parent Required. The parent collection in which the `Target` should be created.
diff --git a/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php b/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php
index e656b77ceb69..fb5c4f0b218d 100644
--- a/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php
+++ b/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php
@@ -25,13 +25,13 @@ class PhaseConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string phase_id = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $phase_id = '';
+ protected $phase_id = '';
/**
* Required. Percentage deployment for the phase.
*
* Generated from protobuf field int32 percentage = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $percentage = 0;
+ protected $percentage = 0;
/**
* Skaffold profiles to use when rendering the manifest for this phase.
* These are in addition to the profiles list specified in the
@@ -45,21 +45,21 @@ class PhaseConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool verify = 4;
*/
- private $verify = false;
+ protected $verify = false;
/**
* Optional. Configuration for the predeploy job of this phase. If this is
* not configured, there will be no predeploy job for this phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $predeploy = null;
+ protected $predeploy = null;
/**
* Optional. Configuration for the postdeploy job of this phase. If this is
* not configured, there will be no postdeploy job for this phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $postdeploy = null;
+ protected $postdeploy = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/CustomTarget.php b/Deploy/src/V1/CustomTarget.php
index 9fb59e74e1e6..cd56d0f9ff5a 100644
--- a/Deploy/src/V1/CustomTarget.php
+++ b/Deploy/src/V1/CustomTarget.php
@@ -21,7 +21,7 @@ class CustomTarget extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string custom_target_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $custom_target_type = '';
+ protected $custom_target_type = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/CustomTargetDeployMetadata.php b/Deploy/src/V1/CustomTargetDeployMetadata.php
index da03557cbf5b..84f7747119b7 100644
--- a/Deploy/src/V1/CustomTargetDeployMetadata.php
+++ b/Deploy/src/V1/CustomTargetDeployMetadata.php
@@ -22,7 +22,7 @@ class CustomTargetDeployMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string skip_message = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $skip_message = '';
+ protected $skip_message = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/CustomTargetSkaffoldActions.php b/Deploy/src/V1/CustomTargetSkaffoldActions.php
index ce9a6791b22a..bd8698c053a8 100644
--- a/Deploy/src/V1/CustomTargetSkaffoldActions.php
+++ b/Deploy/src/V1/CustomTargetSkaffoldActions.php
@@ -23,13 +23,13 @@ class CustomTargetSkaffoldActions extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string render_action = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $render_action = '';
+ protected $render_action = '';
/**
* Required. The Skaffold custom action responsible for deploy operations.
*
* Generated from protobuf field string deploy_action = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $deploy_action = '';
+ protected $deploy_action = '';
/**
* Optional. List of Skaffold modules Cloud Deploy will include in the
* Skaffold Config as required before performing diagnose.
diff --git a/Deploy/src/V1/CustomTargetType.php b/Deploy/src/V1/CustomTargetType.php
index 0de4895368a1..8b54d063c81f 100644
--- a/Deploy/src/V1/CustomTargetType.php
+++ b/Deploy/src/V1/CustomTargetType.php
@@ -26,26 +26,26 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Resource id of the `CustomTargetType`.
*
* Generated from protobuf field string custom_target_type_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $custom_target_type_id = '';
+ protected $custom_target_type_id = '';
/**
* Output only. Unique identifier of the `CustomTargetType`.
*
* Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Optional. Description of the `CustomTargetType`. Max length is 255
* characters.
*
* Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $description = '';
+ protected $description = '';
/**
* Optional. User annotations. These attributes can only be set and used by
* the user, and not by Cloud Deploy. See
@@ -74,13 +74,13 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Most recent time at which the `CustomTargetType` was updated.
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Optional. This checksum is computed by the server based on the value of
* other fields, and may be sent on update and delete requests to ensure the
@@ -88,7 +88,7 @@ class CustomTargetType extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
protected $definition;
/**
diff --git a/Deploy/src/V1/DefaultPool.php b/Deploy/src/V1/DefaultPool.php
index 3bebf4096493..8e6bc4524fa3 100644
--- a/Deploy/src/V1/DefaultPool.php
+++ b/Deploy/src/V1/DefaultPool.php
@@ -22,7 +22,7 @@ class DefaultPool extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string service_account = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $service_account = '';
+ protected $service_account = '';
/**
* Optional. Cloud Storage location where execution outputs should be stored.
* This can either be a bucket ("gs://my-bucket") or a path within a bucket
@@ -31,7 +31,7 @@ class DefaultPool extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string artifact_storage = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $artifact_storage = '';
+ protected $artifact_storage = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/DeleteAutomationRequest.php b/Deploy/src/V1/DeleteAutomationRequest.php
index 9dc2aca2174b..0dc66a756a74 100644
--- a/Deploy/src/V1/DeleteAutomationRequest.php
+++ b/Deploy/src/V1/DeleteAutomationRequest.php
@@ -21,7 +21,7 @@ class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -37,21 +37,21 @@ class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, then deleting an already deleted or non-existing
* `Automation` will succeed.
*
* Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set, validate the request and verify whether the resource
* exists, but do not actually post it.
*
* Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* Optional. The weak etag of the request.
* This checksum is computed by the server based on the value of other
@@ -60,7 +60,7 @@ class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
/**
* @param string $name Required. The name of the `Automation` to delete. Format should be
diff --git a/Deploy/src/V1/DeleteCustomTargetTypeRequest.php b/Deploy/src/V1/DeleteCustomTargetTypeRequest.php
index cc5fbd850526..47939212ecd7 100644
--- a/Deploy/src/V1/DeleteCustomTargetTypeRequest.php
+++ b/Deploy/src/V1/DeleteCustomTargetTypeRequest.php
@@ -21,7 +21,7 @@ class DeleteCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -37,21 +37,21 @@ class DeleteCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, then deleting an already deleted or non-existing
* `CustomTargetType` will succeed.
*
* Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set to true, the request is validated but no actual change is
* made.
*
* Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* Optional. This checksum is computed by the server based on the value of
* other fields, and may be sent on update and delete requests to ensure the
@@ -59,7 +59,7 @@ class DeleteCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
/**
* @param string $name Required. The name of the `CustomTargetType` to delete. Format must be
diff --git a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php
index 4dacb328170f..8a5dfba282d3 100644
--- a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php
+++ b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php
@@ -21,7 +21,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -37,21 +37,21 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, then deleting an already deleted or non-existing
* `DeliveryPipeline` will succeed.
*
* Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set, validate the request and preview the review, but do not
* actually post it.
*
* Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* Optional. If set to true, all child resources under this pipeline will also
* be deleted. Otherwise, the request will only work if the pipeline has no
@@ -59,7 +59,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool force = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $force = false;
+ protected $force = false;
/**
* Optional. This checksum is computed by the server based on the value of
* other fields, and may be sent on update and delete requests to ensure the
@@ -67,7 +67,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
/**
* @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be
diff --git a/Deploy/src/V1/DeleteTargetRequest.php b/Deploy/src/V1/DeleteTargetRequest.php
index 7e2c7858f978..36ef1af47ace 100644
--- a/Deploy/src/V1/DeleteTargetRequest.php
+++ b/Deploy/src/V1/DeleteTargetRequest.php
@@ -21,7 +21,7 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -37,21 +37,21 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, then deleting an already deleted or non-existing
* `Target` will succeed.
*
* Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set, validate the request and preview the review, but do not
* actually post it.
*
* Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* Optional. This checksum is computed by the server based on the value of
* other fields, and may be sent on update and delete requests to ensure the
@@ -59,7 +59,7 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
/**
* @param string $name Required. The name of the `Target` to delete. Format should be
diff --git a/Deploy/src/V1/DeliveryPipeline.php b/Deploy/src/V1/DeliveryPipeline.php
index 251fada507ca..46ae0b0ad9a8 100644
--- a/Deploy/src/V1/DeliveryPipeline.php
+++ b/Deploy/src/V1/DeliveryPipeline.php
@@ -25,19 +25,19 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Description of the `DeliveryPipeline`. Max length is 255 characters.
*
* Generated from protobuf field string description = 3;
*/
- private $description = '';
+ protected $description = '';
/**
* User annotations. These attributes can only be set and used by the
* user, and not by Cloud Deploy.
@@ -64,19 +64,19 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Most recent time at which the pipeline was updated.
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Output only. Information around the state of the Delivery Pipeline.
*
* Generated from protobuf field .google.cloud.deploy.v1.PipelineCondition condition = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $condition = null;
+ protected $condition = null;
/**
* This checksum is computed by the server based on the value of other
* fields, and may be sent on update and delete requests to ensure the
@@ -84,14 +84,14 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 10;
*/
- private $etag = '';
+ protected $etag = '';
/**
* When suspended, no new releases or rollouts can be created,
* but in-progress ones will complete.
*
* Generated from protobuf field bool suspended = 12;
*/
- private $suspended = false;
+ protected $suspended = false;
protected $pipeline;
/**
diff --git a/Deploy/src/V1/DeliveryPipelineNotificationEvent.php b/Deploy/src/V1/DeliveryPipelineNotificationEvent.php
index d982f32c9a5f..835a16910e9e 100644
--- a/Deploy/src/V1/DeliveryPipelineNotificationEvent.php
+++ b/Deploy/src/V1/DeliveryPipelineNotificationEvent.php
@@ -22,25 +22,25 @@ class DeliveryPipelineNotificationEvent extends \Google\Protobuf\Internal\Messag
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 4;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* The name of the `Delivery Pipeline`.
*
* Generated from protobuf field string delivery_pipeline = 2;
*/
- private $delivery_pipeline = '';
+ protected $delivery_pipeline = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 3;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/DeployArtifact.php b/Deploy/src/V1/DeployArtifact.php
index d79a9f4b984c..f7b78f40dd51 100644
--- a/Deploy/src/V1/DeployArtifact.php
+++ b/Deploy/src/V1/DeployArtifact.php
@@ -21,7 +21,7 @@ class DeployArtifact extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string artifact_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $artifact_uri = '';
+ protected $artifact_uri = '';
/**
* Output only. File paths of the manifests applied during the deploy
* operation relative to the URI.
diff --git a/Deploy/src/V1/DeployJobRun.php b/Deploy/src/V1/DeployJobRun.php
index c309be058cc1..87d81854fcbb 100644
--- a/Deploy/src/V1/DeployJobRun.php
+++ b/Deploy/src/V1/DeployJobRun.php
@@ -22,32 +22,32 @@ class DeployJobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $build = '';
+ protected $build = '';
/**
* Output only. The reason the deploy failed. This will always be unspecified
* while the deploy is in progress or if it succeeded.
*
* Generated from protobuf field .google.cloud.deploy.v1.DeployJobRun.FailureCause failure_cause = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_cause = 0;
+ protected $failure_cause = 0;
/**
* Output only. Additional information about the deploy failure, if available.
*
* Generated from protobuf field string failure_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_message = '';
+ protected $failure_message = '';
/**
* Output only. Metadata containing information about the deploy job run.
*
* Generated from protobuf field .google.cloud.deploy.v1.DeployJobRunMetadata metadata = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $metadata = null;
+ protected $metadata = null;
/**
* Output only. The artifact of a deploy job run, if available.
*
* Generated from protobuf field .google.cloud.deploy.v1.DeployArtifact artifact = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $artifact = null;
+ protected $artifact = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/DeployJobRunMetadata.php b/Deploy/src/V1/DeployJobRunMetadata.php
index 05ca7225981c..b1a4c47c9cbd 100644
--- a/Deploy/src/V1/DeployJobRunMetadata.php
+++ b/Deploy/src/V1/DeployJobRunMetadata.php
@@ -22,19 +22,19 @@ class DeployJobRunMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.CloudRunMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $cloud_run = null;
+ protected $cloud_run = null;
/**
* Output only. Custom Target metadata associated with a `DeployJobRun`.
*
* Generated from protobuf field .google.cloud.deploy.v1.CustomTargetDeployMetadata custom_target = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $custom_target = null;
+ protected $custom_target = null;
/**
* Output only. Custom metadata provided by user-defined deploy operation.
*
* Generated from protobuf field .google.cloud.deploy.v1.CustomMetadata custom = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $custom = null;
+ protected $custom = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/DeploymentJobs.php b/Deploy/src/V1/DeploymentJobs.php
index 561b42520eed..a4335b13b770 100644
--- a/Deploy/src/V1/DeploymentJobs.php
+++ b/Deploy/src/V1/DeploymentJobs.php
@@ -20,25 +20,25 @@ class DeploymentJobs extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Job deploy_job = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $deploy_job = null;
+ protected $deploy_job = null;
/**
* Output only. The verify Job. Runs after a deploy if the deploy succeeds.
*
* Generated from protobuf field .google.cloud.deploy.v1.Job verify_job = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $verify_job = null;
+ protected $verify_job = null;
/**
* Output only. The predeploy Job, which is the first job on the phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Job predeploy_job = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $predeploy_job = null;
+ protected $predeploy_job = null;
/**
* Output only. The postdeploy Job, which is the last job on the phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Job postdeploy_job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $postdeploy_job = null;
+ protected $postdeploy_job = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/ExecutionConfig.php b/Deploy/src/V1/ExecutionConfig.php
index 7005f02b9b64..3596cd3fcfa4 100644
--- a/Deploy/src/V1/ExecutionConfig.php
+++ b/Deploy/src/V1/ExecutionConfig.php
@@ -29,7 +29,7 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string worker_pool = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
*/
- private $worker_pool = '';
+ protected $worker_pool = '';
/**
* Optional. Google service account to use for execution. If unspecified,
* the project execution service account
@@ -37,7 +37,7 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $service_account = '';
+ protected $service_account = '';
/**
* Optional. Cloud Storage location in which to store execution outputs. This
* can either be a bucket ("gs://my-bucket") or a path within a bucket
@@ -46,7 +46,7 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string artifact_storage = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $artifact_storage = '';
+ protected $artifact_storage = '';
/**
* Optional. Execution timeout for a Cloud Build Execution. This must be
* between 10m and 24h in seconds format. If unspecified, a default timeout of
@@ -54,14 +54,14 @@ class ExecutionConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Duration execution_timeout = 7 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $execution_timeout = null;
+ protected $execution_timeout = null;
/**
* Optional. If true, additional logging will be enabled when running builds
* in this execution environment.
*
* Generated from protobuf field bool verbose = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $verbose = false;
+ protected $verbose = false;
protected $execution_environment;
/**
diff --git a/Deploy/src/V1/Gapic/CloudDeployGapicClient.php b/Deploy/src/V1/Gapic/CloudDeployGapicClient.php
deleted file mode 100644
index f8135096c136..000000000000
--- a/Deploy/src/V1/Gapic/CloudDeployGapicClient.php
+++ /dev/null
@@ -1,4577 +0,0 @@
-releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- * $response = $cloudDeployClient->abandonRelease($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * Many parameters require resource names to be formatted in a particular way. To
- * assist with these names, this class includes a format method for each type of
- * name, and additionally a parseName method to extract the individual identifiers
- * contained within formatted names that are returned by the API.
- *
- * @deprecated Please use the new service client {@see \Google\Cloud\Deploy\V1\Client\CloudDeployClient}.
- */
-class CloudDeployGapicClient
-{
- use GapicClientTrait;
-
- /** The name of the service. */
- const SERVICE_NAME = 'google.cloud.deploy.v1.CloudDeploy';
-
- /**
- * The default address of the service.
- *
- * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead.
- */
- const SERVICE_ADDRESS = 'clouddeploy.googleapis.com';
-
- /** The address template of the service. */
- private const SERVICE_ADDRESS_TEMPLATE = 'clouddeploy.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',
- ];
-
- private static $automationNameTemplate;
-
- private static $automationRunNameTemplate;
-
- private static $buildNameTemplate;
-
- private static $clusterNameTemplate;
-
- private static $configNameTemplate;
-
- private static $customTargetTypeNameTemplate;
-
- private static $deliveryPipelineNameTemplate;
-
- private static $jobNameTemplate;
-
- private static $jobRunNameTemplate;
-
- private static $locationNameTemplate;
-
- private static $membershipNameTemplate;
-
- private static $releaseNameTemplate;
-
- private static $repositoryNameTemplate;
-
- private static $rolloutNameTemplate;
-
- private static $serviceNameTemplate;
-
- private static $targetNameTemplate;
-
- private static $workerPoolNameTemplate;
-
- private static $pathTemplateMap;
-
- private $operationsClient;
-
- private static function getClientDefaults()
- {
- return [
- 'serviceName' => self::SERVICE_NAME,
- 'apiEndpoint' =>
- self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
- 'clientConfig' =>
- __DIR__ . '/../resources/cloud_deploy_client_config.json',
- 'descriptorsConfigPath' =>
- __DIR__ . '/../resources/cloud_deploy_descriptor_config.php',
- 'gcpApiConfigPath' =>
- __DIR__ . '/../resources/cloud_deploy_grpc_config.json',
- 'credentialsConfig' => [
- 'defaultScopes' => self::$serviceScopes,
- ],
- 'transportConfig' => [
- 'rest' => [
- 'restClientConfigPath' =>
- __DIR__ .
- '/../resources/cloud_deploy_rest_client_config.php',
- ],
- ],
- ];
- }
-
- private static function getAutomationNameTemplate()
- {
- if (self::$automationNameTemplate == null) {
- self::$automationNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}'
- );
- }
-
- return self::$automationNameTemplate;
- }
-
- private static function getAutomationRunNameTemplate()
- {
- if (self::$automationRunNameTemplate == null) {
- self::$automationRunNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}'
- );
- }
-
- return self::$automationRunNameTemplate;
- }
-
- private static function getBuildNameTemplate()
- {
- if (self::$buildNameTemplate == null) {
- self::$buildNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/builds/{build}'
- );
- }
-
- return self::$buildNameTemplate;
- }
-
- private static function getClusterNameTemplate()
- {
- if (self::$clusterNameTemplate == null) {
- self::$clusterNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/clusters/{cluster}'
- );
- }
-
- return self::$clusterNameTemplate;
- }
-
- private static function getConfigNameTemplate()
- {
- if (self::$configNameTemplate == null) {
- self::$configNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/config'
- );
- }
-
- return self::$configNameTemplate;
- }
-
- private static function getCustomTargetTypeNameTemplate()
- {
- if (self::$customTargetTypeNameTemplate == null) {
- self::$customTargetTypeNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}'
- );
- }
-
- return self::$customTargetTypeNameTemplate;
- }
-
- private static function getDeliveryPipelineNameTemplate()
- {
- if (self::$deliveryPipelineNameTemplate == null) {
- self::$deliveryPipelineNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}'
- );
- }
-
- return self::$deliveryPipelineNameTemplate;
- }
-
- private static function getJobNameTemplate()
- {
- if (self::$jobNameTemplate == null) {
- self::$jobNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/jobs/{job}'
- );
- }
-
- return self::$jobNameTemplate;
- }
-
- private static function getJobRunNameTemplate()
- {
- if (self::$jobRunNameTemplate == null) {
- self::$jobRunNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}'
- );
- }
-
- return self::$jobRunNameTemplate;
- }
-
- private static function getLocationNameTemplate()
- {
- if (self::$locationNameTemplate == null) {
- self::$locationNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}'
- );
- }
-
- return self::$locationNameTemplate;
- }
-
- private static function getMembershipNameTemplate()
- {
- if (self::$membershipNameTemplate == null) {
- self::$membershipNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/memberships/{membership}'
- );
- }
-
- return self::$membershipNameTemplate;
- }
-
- private static function getReleaseNameTemplate()
- {
- if (self::$releaseNameTemplate == null) {
- self::$releaseNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}'
- );
- }
-
- return self::$releaseNameTemplate;
- }
-
- private static function getRepositoryNameTemplate()
- {
- if (self::$repositoryNameTemplate == null) {
- self::$repositoryNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}'
- );
- }
-
- return self::$repositoryNameTemplate;
- }
-
- private static function getRolloutNameTemplate()
- {
- if (self::$rolloutNameTemplate == null) {
- self::$rolloutNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}'
- );
- }
-
- return self::$rolloutNameTemplate;
- }
-
- private static function getServiceNameTemplate()
- {
- if (self::$serviceNameTemplate == null) {
- self::$serviceNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/services/{service}'
- );
- }
-
- return self::$serviceNameTemplate;
- }
-
- private static function getTargetNameTemplate()
- {
- if (self::$targetNameTemplate == null) {
- self::$targetNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/targets/{target}'
- );
- }
-
- return self::$targetNameTemplate;
- }
-
- private static function getWorkerPoolNameTemplate()
- {
- if (self::$workerPoolNameTemplate == null) {
- self::$workerPoolNameTemplate = new PathTemplate(
- 'projects/{project}/locations/{location}/workerPools/{worker_pool}'
- );
- }
-
- return self::$workerPoolNameTemplate;
- }
-
- private static function getPathTemplateMap()
- {
- if (self::$pathTemplateMap == null) {
- self::$pathTemplateMap = [
- 'automation' => self::getAutomationNameTemplate(),
- 'automationRun' => self::getAutomationRunNameTemplate(),
- 'build' => self::getBuildNameTemplate(),
- 'cluster' => self::getClusterNameTemplate(),
- 'config' => self::getConfigNameTemplate(),
- 'customTargetType' => self::getCustomTargetTypeNameTemplate(),
- 'deliveryPipeline' => self::getDeliveryPipelineNameTemplate(),
- 'job' => self::getJobNameTemplate(),
- 'jobRun' => self::getJobRunNameTemplate(),
- 'location' => self::getLocationNameTemplate(),
- 'membership' => self::getMembershipNameTemplate(),
- 'release' => self::getReleaseNameTemplate(),
- 'repository' => self::getRepositoryNameTemplate(),
- 'rollout' => self::getRolloutNameTemplate(),
- 'service' => self::getServiceNameTemplate(),
- 'target' => self::getTargetNameTemplate(),
- 'workerPool' => self::getWorkerPoolNameTemplate(),
- ];
- }
-
- return self::$pathTemplateMap;
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a automation
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deliveryPipeline
- * @param string $automation
- *
- * @return string The formatted automation resource.
- */
- public static function automationName(
- $project,
- $location,
- $deliveryPipeline,
- $automation
- ) {
- return self::getAutomationNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'delivery_pipeline' => $deliveryPipeline,
- 'automation' => $automation,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a
- * automation_run resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deliveryPipeline
- * @param string $automationRun
- *
- * @return string The formatted automation_run resource.
- */
- public static function automationRunName(
- $project,
- $location,
- $deliveryPipeline,
- $automationRun
- ) {
- return self::getAutomationRunNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'delivery_pipeline' => $deliveryPipeline,
- 'automation_run' => $automationRun,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a build
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $build
- *
- * @return string The formatted build resource.
- */
- public static function buildName($project, $location, $build)
- {
- return self::getBuildNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'build' => $build,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a cluster
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $cluster
- *
- * @return string The formatted cluster resource.
- */
- public static function clusterName($project, $location, $cluster)
- {
- return self::getClusterNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'cluster' => $cluster,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a config
- * resource.
- *
- * @param string $project
- * @param string $location
- *
- * @return string The formatted config resource.
- */
- public static function configName($project, $location)
- {
- return self::getConfigNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a
- * custom_target_type resource.
- *
- * @param string $project
- * @param string $location
- * @param string $customTargetType
- *
- * @return string The formatted custom_target_type resource.
- */
- public static function customTargetTypeName(
- $project,
- $location,
- $customTargetType
- ) {
- return self::getCustomTargetTypeNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'custom_target_type' => $customTargetType,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a
- * delivery_pipeline resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deliveryPipeline
- *
- * @return string The formatted delivery_pipeline resource.
- */
- public static function deliveryPipelineName(
- $project,
- $location,
- $deliveryPipeline
- ) {
- return self::getDeliveryPipelineNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'delivery_pipeline' => $deliveryPipeline,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a job
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $job
- *
- * @return string The formatted job resource.
- */
- public static function jobName($project, $location, $job)
- {
- return self::getJobNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'job' => $job,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a job_run
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deliveryPipeline
- * @param string $release
- * @param string $rollout
- * @param string $jobRun
- *
- * @return string The formatted job_run resource.
- */
- public static function jobRunName(
- $project,
- $location,
- $deliveryPipeline,
- $release,
- $rollout,
- $jobRun
- ) {
- return self::getJobRunNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'delivery_pipeline' => $deliveryPipeline,
- 'release' => $release,
- 'rollout' => $rollout,
- 'job_run' => $jobRun,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a location
- * resource.
- *
- * @param string $project
- * @param string $location
- *
- * @return string The formatted location resource.
- */
- public static function locationName($project, $location)
- {
- return self::getLocationNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a membership
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $membership
- *
- * @return string The formatted membership resource.
- */
- public static function membershipName($project, $location, $membership)
- {
- return self::getMembershipNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'membership' => $membership,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a release
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deliveryPipeline
- * @param string $release
- *
- * @return string The formatted release resource.
- */
- public static function releaseName(
- $project,
- $location,
- $deliveryPipeline,
- $release
- ) {
- return self::getReleaseNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'delivery_pipeline' => $deliveryPipeline,
- 'release' => $release,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a repository
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $connection
- * @param string $repository
- *
- * @return string The formatted repository resource.
- */
- public static function repositoryName(
- $project,
- $location,
- $connection,
- $repository
- ) {
- return self::getRepositoryNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'connection' => $connection,
- 'repository' => $repository,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a rollout
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $deliveryPipeline
- * @param string $release
- * @param string $rollout
- *
- * @return string The formatted rollout resource.
- */
- public static function rolloutName(
- $project,
- $location,
- $deliveryPipeline,
- $release,
- $rollout
- ) {
- return self::getRolloutNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'delivery_pipeline' => $deliveryPipeline,
- 'release' => $release,
- 'rollout' => $rollout,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a service
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $service
- *
- * @return string The formatted service resource.
- */
- public static function serviceName($project, $location, $service)
- {
- return self::getServiceNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'service' => $service,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a target
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $target
- *
- * @return string The formatted target resource.
- */
- public static function targetName($project, $location, $target)
- {
- return self::getTargetNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'target' => $target,
- ]);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a worker_pool
- * resource.
- *
- * @param string $project
- * @param string $location
- * @param string $workerPool
- *
- * @return string The formatted worker_pool resource.
- */
- public static function workerPoolName($project, $location, $workerPool)
- {
- return self::getWorkerPoolNameTemplate()->render([
- 'project' => $project,
- 'location' => $location,
- 'worker_pool' => $workerPool,
- ]);
- }
-
- /**
- * Parses a formatted name string and returns an associative array of the components in the name.
- * The following name formats are supported:
- * Template: Pattern
- * - automation: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}
- * - automationRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}
- * - build: projects/{project}/locations/{location}/builds/{build}
- * - cluster: projects/{project}/locations/{location}/clusters/{cluster}
- * - config: projects/{project}/locations/{location}/config
- * - customTargetType: projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}
- * - deliveryPipeline: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}
- * - job: projects/{project}/locations/{location}/jobs/{job}
- * - jobRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}
- * - location: projects/{project}/locations/{location}
- * - membership: projects/{project}/locations/{location}/memberships/{membership}
- * - release: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}
- * - repository: projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}
- * - rollout: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}
- * - service: projects/{project}/locations/{location}/services/{service}
- * - target: projects/{project}/locations/{location}/targets/{target}
- * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool}
- *
- * The optional $template argument can be supplied to specify a particular pattern,
- * and must match one of the templates listed above. If no $template argument is
- * provided, or if the $template argument does not match one of the templates
- * listed, then parseName will check each of the supported templates, and return
- * the first match.
- *
- * @param string $formattedName The formatted name string
- * @param string $template Optional name of template to match
- *
- * @return array An associative array from name component IDs to component values.
- *
- * @throws ValidationException If $formattedName could not be matched.
- */
- public static function parseName($formattedName, $template = null)
- {
- $templateMap = self::getPathTemplateMap();
- if ($template) {
- if (!isset($templateMap[$template])) {
- throw new ValidationException(
- "Template name $template does not exist"
- );
- }
-
- return $templateMap[$template]->match($formattedName);
- }
-
- foreach ($templateMap as $templateName => $pathTemplate) {
- try {
- return $pathTemplate->match($formattedName);
- } catch (ValidationException $ex) {
- // Swallow the exception to continue trying other path templates
- }
- }
-
- throw new ValidationException(
- "Input did not match any known format. Input: $formattedName"
- );
- }
-
- /**
- * Return an OperationsClient object with the same endpoint as $this.
- *
- * @return OperationsClient
- */
- public function getOperationsClient()
- {
- return $this->operationsClient;
- }
-
- /**
- * Resume an existing long running operation that was previously started by a long
- * running API method. If $methodName is not provided, or does not match a long
- * running API method, then the operation can still be resumed, but the
- * OperationResponse object will not deserialize the final response.
- *
- * @param string $operationName The name of the long running operation
- * @param string $methodName The name of the method used to start the operation
- *
- * @return OperationResponse
- */
- public function resumeOperation($operationName, $methodName = null)
- {
- $options = isset($this->descriptors[$methodName]['longRunning'])
- ? $this->descriptors[$methodName]['longRunning']
- : [];
- $operation = new OperationResponse(
- $operationName,
- $this->getOperationsClient(),
- $options
- );
- $operation->reload();
- return $operation;
- }
-
- /**
- * 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 'clouddeploy.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
- */
- public function __construct(array $options = [])
- {
- $clientOptions = $this->buildClientOptions($options);
- $this->setClientOptions($clientOptions);
- $this->operationsClient = $this->createOperationsClient($clientOptions);
- }
-
- /**
- * Abandons a Release in the Delivery Pipeline.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- * $response = $cloudDeployClient->abandonRelease($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the Release. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\AbandonReleaseResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function abandonRelease($name, array $optionalArgs = [])
- {
- $request = new AbandonReleaseRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'AbandonRelease',
- AbandonReleaseResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Advances a Rollout in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * $phaseId = 'phase_id';
- * $response = $cloudDeployClient->advanceRollout($formattedName, $phaseId);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the Rollout. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
- * @param string $phaseId Required. The phase ID to advance the `Rollout` to.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\AdvanceRolloutResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function advanceRollout($name, $phaseId, array $optionalArgs = [])
- {
- $request = new AdvanceRolloutRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $request->setPhaseId($phaseId);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'AdvanceRollout',
- AdvanceRolloutResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Approves a Rollout.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * $approved = false;
- * $response = $cloudDeployClient->approveRollout($formattedName, $approved);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the Rollout. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
- * @param bool $approved Required. True = approve; false = reject
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\ApproveRolloutResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function approveRollout($name, $approved, array $optionalArgs = [])
- {
- $request = new ApproveRolloutRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $request->setApproved($approved);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'ApproveRollout',
- ApproveRolloutResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Cancels an AutomationRun. The `state` of the `AutomationRun` after
- * cancelling is `CANCELLED`. `CancelAutomationRun` can be called on
- * AutomationRun in the state `IN_PROGRESS` and `PENDING`; AutomationRun
- * in a different state returns an `FAILED_PRECONDITION` error.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- * $response = $cloudDeployClient->cancelAutomationRun($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `AutomationRun`. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\CancelAutomationRunResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function cancelAutomationRun($name, array $optionalArgs = [])
- {
- $request = new CancelAutomationRunRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'CancelAutomationRun',
- CancelAutomationRunResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Cancels a Rollout in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * $response = $cloudDeployClient->cancelRollout($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the Rollout. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\CancelRolloutResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function cancelRollout($name, array $optionalArgs = [])
- {
- $request = new CancelRolloutRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'CancelRollout',
- CancelRolloutResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Creates a new Automation in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * $automationId = 'automation_id';
- * $automation = new Automation();
- * $operationResponse = $cloudDeployClient->createAutomation($formattedParent, $automationId, $automation);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->createAutomation($formattedParent, $automationId, $automation);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createAutomation');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent collection in which the `Automation` should be
- * created. Format should be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
- * @param string $automationId Required. ID of the `Automation`.
- * @param Automation $automation Required. The `Automation` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function createAutomation(
- $parent,
- $automationId,
- $automation,
- array $optionalArgs = []
- ) {
- $request = new CreateAutomationRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $request->setAutomationId($automationId);
- $request->setAutomation($automation);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- 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->startOperationsCall(
- 'CreateAutomation',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Creates a new CustomTargetType in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]');
- * $customTargetTypeId = 'custom_target_type_id';
- * $customTargetType = new CustomTargetType();
- * $operationResponse = $cloudDeployClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createCustomTargetType');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent collection in which the `CustomTargetType` should be
- * created. Format should be
- * `projects/{project_id}/locations/{location_name}`.
- * @param string $customTargetTypeId Required. ID of the `CustomTargetType`.
- * @param CustomTargetType $customTargetType Required. The `CustomTargetType` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function createCustomTargetType(
- $parent,
- $customTargetTypeId,
- $customTargetType,
- array $optionalArgs = []
- ) {
- $request = new CreateCustomTargetTypeRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $request->setCustomTargetTypeId($customTargetTypeId);
- $request->setCustomTargetType($customTargetType);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- 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->startOperationsCall(
- 'CreateCustomTargetType',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Creates a new DeliveryPipeline in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]');
- * $deliveryPipelineId = 'delivery_pipeline_id';
- * $deliveryPipeline = new DeliveryPipeline();
- * $operationResponse = $cloudDeployClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createDeliveryPipeline');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be
- * created. Format should be
- * `projects/{project_id}/locations/{location_name}`.
- * @param string $deliveryPipelineId Required. ID of the `DeliveryPipeline`.
- * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function createDeliveryPipeline(
- $parent,
- $deliveryPipelineId,
- $deliveryPipeline,
- array $optionalArgs = []
- ) {
- $request = new CreateDeliveryPipelineRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $request->setDeliveryPipelineId($deliveryPipelineId);
- $request->setDeliveryPipeline($deliveryPipeline);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- 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->startOperationsCall(
- 'CreateDeliveryPipeline',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Creates a new Release in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * $releaseId = 'release_id';
- * $release = new Release();
- * $operationResponse = $cloudDeployClient->createRelease($formattedParent, $releaseId, $release);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->createRelease($formattedParent, $releaseId, $release);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createRelease');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent collection in which the `Release` should be created.
- * Format should be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
- * @param string $releaseId Required. ID of the `Release`.
- * @param Release $release Required. The `Release` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function createRelease(
- $parent,
- $releaseId,
- $release,
- array $optionalArgs = []
- ) {
- $request = new CreateReleaseRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $request->setReleaseId($releaseId);
- $request->setRelease($release);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- 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->startOperationsCall(
- 'CreateRelease',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Creates a new Rollout in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- * $rolloutId = 'rollout_id';
- * $rollout = new Rollout();
- * $operationResponse = $cloudDeployClient->createRollout($formattedParent, $rolloutId, $rollout);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->createRollout($formattedParent, $rolloutId, $rollout);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createRollout');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent collection in which the `Rollout` should be created.
- * Format should be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
- * @param string $rolloutId Required. ID of the `Rollout`.
- * @param Rollout $rollout Required. The `Rollout` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @type string $startingPhaseId
- * Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
- * will start at the first phase.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function createRollout(
- $parent,
- $rolloutId,
- $rollout,
- array $optionalArgs = []
- ) {
- $request = new CreateRolloutRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $request->setRolloutId($rolloutId);
- $request->setRollout($rollout);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['validateOnly'])) {
- $request->setValidateOnly($optionalArgs['validateOnly']);
- }
-
- if (isset($optionalArgs['startingPhaseId'])) {
- $request->setStartingPhaseId($optionalArgs['startingPhaseId']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startOperationsCall(
- 'CreateRollout',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Creates a new Target in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]');
- * $targetId = 'target_id';
- * $target = new Target();
- * $operationResponse = $cloudDeployClient->createTarget($formattedParent, $targetId, $target);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->createTarget($formattedParent, $targetId, $target);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createTarget');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent collection in which the `Target` should be created.
- * Format should be
- * `projects/{project_id}/locations/{location_name}`.
- * @param string $targetId Required. ID of the `Target`.
- * @param Target $target Required. The `Target` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function createTarget(
- $parent,
- $targetId,
- $target,
- array $optionalArgs = []
- ) {
- $request = new CreateTargetRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $request->setTargetId($targetId);
- $request->setTarget($target);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- 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->startOperationsCall(
- 'CreateTarget',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Deletes a single Automation resource.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- * $operationResponse = $cloudDeployClient->deleteAutomation($formattedName);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->deleteAutomation($formattedName);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteAutomation');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. The name of the `Automation` to delete. Format should be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, then deleting an already deleted or non-existing
- * `Automation` will succeed.
- * @type bool $validateOnly
- * Optional. If set, validate the request and verify whether the resource
- * exists, but do not actually post it.
- * @type string $etag
- * Optional. The weak etag of the request.
- * This checksum is computed by the server based on the value of other
- * fields, and may be sent on update and delete requests to ensure the
- * client has an up-to-date value before proceeding.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function deleteAutomation($name, array $optionalArgs = [])
- {
- $request = new DeleteAutomationRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- if (isset($optionalArgs['validateOnly'])) {
- $request->setValidateOnly($optionalArgs['validateOnly']);
- }
-
- if (isset($optionalArgs['etag'])) {
- $request->setEtag($optionalArgs['etag']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startOperationsCall(
- 'DeleteAutomation',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Deletes a single CustomTargetType.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- * $operationResponse = $cloudDeployClient->deleteCustomTargetType($formattedName);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->deleteCustomTargetType($formattedName);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteCustomTargetType');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. The name of the `CustomTargetType` to delete. Format must be
- * `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, then deleting an already deleted or non-existing
- * `CustomTargetType` will succeed.
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated but no actual change is
- * made.
- * @type string $etag
- * Optional. This checksum is computed by the server based on the value of
- * other fields, and may be sent on update and delete requests to ensure the
- * client has an up-to-date value before proceeding.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function deleteCustomTargetType($name, array $optionalArgs = [])
- {
- $request = new DeleteCustomTargetTypeRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- if (isset($optionalArgs['validateOnly'])) {
- $request->setValidateOnly($optionalArgs['validateOnly']);
- }
-
- if (isset($optionalArgs['etag'])) {
- $request->setEtag($optionalArgs['etag']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startOperationsCall(
- 'DeleteCustomTargetType',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Deletes a single DeliveryPipeline.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteDeliveryPipeline');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, then deleting an already deleted or non-existing
- * `DeliveryPipeline` will succeed.
- * @type bool $validateOnly
- * Optional. If set, validate the request and preview the review, but do not
- * actually post it.
- * @type bool $force
- * Optional. If set to true, all child resources under this pipeline will also
- * be deleted. Otherwise, the request will only work if the pipeline has no
- * child resources.
- * @type string $etag
- * Optional. This checksum is computed by the server based on the value of
- * other fields, and may be sent on update and delete requests to ensure the
- * client has an up-to-date value before proceeding.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function deleteDeliveryPipeline($name, array $optionalArgs = [])
- {
- $request = new DeleteDeliveryPipelineRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- if (isset($optionalArgs['validateOnly'])) {
- $request->setValidateOnly($optionalArgs['validateOnly']);
- }
-
- if (isset($optionalArgs['force'])) {
- $request->setForce($optionalArgs['force']);
- }
-
- if (isset($optionalArgs['etag'])) {
- $request->setEtag($optionalArgs['etag']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startOperationsCall(
- 'DeleteDeliveryPipeline',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Deletes a single Target.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- * $operationResponse = $cloudDeployClient->deleteTarget($formattedName);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->deleteTarget($formattedName);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteTarget');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * // operation succeeded and returns no value
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. The name of the `Target` to delete. Format should be
- * `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, then deleting an already deleted or non-existing
- * `Target` will succeed.
- * @type bool $validateOnly
- * Optional. If set, validate the request and preview the review, but do not
- * actually post it.
- * @type string $etag
- * Optional. This checksum is computed by the server based on the value of
- * other fields, and may be sent on update and delete requests to ensure the
- * client has an up-to-date value before proceeding.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function deleteTarget($name, array $optionalArgs = [])
- {
- $request = new DeleteTargetRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- if (isset($optionalArgs['validateOnly'])) {
- $request->setValidateOnly($optionalArgs['validateOnly']);
- }
-
- if (isset($optionalArgs['etag'])) {
- $request->setEtag($optionalArgs['etag']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startOperationsCall(
- 'DeleteTarget',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Gets details of a single Automation.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- * $response = $cloudDeployClient->getAutomation($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `Automation`. Format must be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\Automation
- *
- * @throws ApiException if the remote call fails
- */
- public function getAutomation($name, array $optionalArgs = [])
- {
- $request = new GetAutomationRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetAutomation',
- Automation::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single AutomationRun.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- * $response = $cloudDeployClient->getAutomationRun($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `AutomationRun`. Format must be
- * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\AutomationRun
- *
- * @throws ApiException if the remote call fails
- */
- public function getAutomationRun($name, array $optionalArgs = [])
- {
- $request = new GetAutomationRunRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetAutomationRun',
- AutomationRun::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets the configuration for a location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->configName('[PROJECT]', '[LOCATION]');
- * $response = $cloudDeployClient->getConfig($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of requested configuration.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\Config
- *
- * @throws ApiException if the remote call fails
- */
- public function getConfig($name, array $optionalArgs = [])
- {
- $request = new GetConfigRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetConfig',
- Config::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single CustomTargetType.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- * $response = $cloudDeployClient->getCustomTargetType($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `CustomTargetType`. Format must be
- * `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\CustomTargetType
- *
- * @throws ApiException if the remote call fails
- */
- public function getCustomTargetType($name, array $optionalArgs = [])
- {
- $request = new GetCustomTargetTypeRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetCustomTargetType',
- CustomTargetType::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single DeliveryPipeline.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * $response = $cloudDeployClient->getDeliveryPipeline($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `DeliveryPipeline`. Format must be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\DeliveryPipeline
- *
- * @throws ApiException if the remote call fails
- */
- public function getDeliveryPipeline($name, array $optionalArgs = [])
- {
- $request = new GetDeliveryPipelineRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetDeliveryPipeline',
- DeliveryPipeline::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single JobRun.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- * $response = $cloudDeployClient->getJobRun($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `JobRun`. Format must be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\JobRun
- *
- * @throws ApiException if the remote call fails
- */
- public function getJobRun($name, array $optionalArgs = [])
- {
- $request = new GetJobRunRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetJobRun',
- JobRun::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single Release.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- * $response = $cloudDeployClient->getRelease($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `Release`. Format must be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\Release
- *
- * @throws ApiException if the remote call fails
- */
- public function getRelease($name, array $optionalArgs = [])
- {
- $request = new GetReleaseRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetRelease',
- Release::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single Rollout.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * $response = $cloudDeployClient->getRollout($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `Rollout`. Format must be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\Rollout
- *
- * @throws ApiException if the remote call fails
- */
- public function getRollout($name, array $optionalArgs = [])
- {
- $request = new GetRolloutRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetRollout',
- Rollout::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Gets details of a single Target.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- * $response = $cloudDeployClient->getTarget($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `Target`. Format must be
- * `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\Target
- *
- * @throws ApiException if the remote call fails
- */
- public function getTarget($name, array $optionalArgs = [])
- {
- $request = new GetTargetRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetTarget',
- Target::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Ignores the specified Job in a Rollout.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedRollout = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * $phaseId = 'phase_id';
- * $jobId = 'job_id';
- * $response = $cloudDeployClient->ignoreJob($formattedRollout, $phaseId, $jobId);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $rollout Required. Name of the Rollout. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
- * @param string $phaseId Required. The phase ID the Job to ignore belongs to.
- * @param string $jobId Required. The job ID for the Job to ignore.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\IgnoreJobResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function ignoreJob(
- $rollout,
- $phaseId,
- $jobId,
- array $optionalArgs = []
- ) {
- $request = new IgnoreJobRequest();
- $requestParamHeaders = [];
- $request->setRollout($rollout);
- $request->setPhaseId($phaseId);
- $request->setJobId($jobId);
- $requestParamHeaders['rollout'] = $rollout;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'IgnoreJob',
- IgnoreJobResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Lists AutomationRuns in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listAutomationRuns($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listAutomationRuns($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of
- * automationRuns. Format must be
- * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Filter automationRuns to be returned. All fields can be used in the
- * filter.
- * @type string $orderBy
- * Field to sort by.
- * @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
- */
- public function listAutomationRuns($parent, array $optionalArgs = [])
- {
- $request = new ListAutomationRunsRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListAutomationRuns',
- $optionalArgs,
- ListAutomationRunsResponse::class,
- $request
- );
- }
-
- /**
- * Lists Automations in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listAutomations($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listAutomations($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of
- * automations. Format must be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Filter automations to be returned. All fields can be used in the
- * filter.
- * @type string $orderBy
- * Field to sort by.
- * @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
- */
- public function listAutomations($parent, array $optionalArgs = [])
- {
- $request = new ListAutomationsRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListAutomations',
- $optionalArgs,
- ListAutomationsResponse::class,
- $request
- );
- }
-
- /**
- * Lists CustomTargetTypes in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listCustomTargetTypes($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listCustomTargetTypes($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent that owns this collection of custom target types.
- * Format must be `projects/{project_id}/locations/{location_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Optional. Filter custom target types to be returned. See
- * https://google.aip.dev/160 for more details.
- * @type string $orderBy
- * Optional. Field to sort by. See https://google.aip.dev/132#ordering for
- * more details.
- * @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
- */
- public function listCustomTargetTypes($parent, array $optionalArgs = [])
- {
- $request = new ListCustomTargetTypesRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListCustomTargetTypes',
- $optionalArgs,
- ListCustomTargetTypesResponse::class,
- $request
- );
- }
-
- /**
- * Lists DeliveryPipelines in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listDeliveryPipelines($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listDeliveryPipelines($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent, which owns this collection of pipelines. Format must
- * be `projects/{project_id}/locations/{location_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Filter pipelines to be returned. See https://google.aip.dev/160 for more
- * details.
- * @type string $orderBy
- * Field to sort by. See https://google.aip.dev/132#ordering for more details.
- * @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
- */
- public function listDeliveryPipelines($parent, array $optionalArgs = [])
- {
- $request = new ListDeliveryPipelinesRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListDeliveryPipelines',
- $optionalArgs,
- ListDeliveryPipelinesResponse::class,
- $request
- );
- }
-
- /**
- * Lists JobRuns in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listJobRuns($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listJobRuns($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The `Rollout` which owns this collection of `JobRun` objects.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Optional. Filter results to be returned. See https://google.aip.dev/160 for
- * more details.
- * @type string $orderBy
- * Optional. Field to sort by. See https://google.aip.dev/132#ordering for
- * more details.
- * @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
- */
- public function listJobRuns($parent, array $optionalArgs = [])
- {
- $request = new ListJobRunsRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListJobRuns',
- $optionalArgs,
- ListJobRunsResponse::class,
- $request
- );
- }
-
- /**
- * Lists Releases in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listReleases($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listReleases($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The `DeliveryPipeline` which owns this collection of `Release`
- * objects.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Optional. Filter releases to be returned. See https://google.aip.dev/160
- * for more details.
- * @type string $orderBy
- * Optional. Field to sort by. See https://google.aip.dev/132#ordering for
- * more details.
- * @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
- */
- public function listReleases($parent, array $optionalArgs = [])
- {
- $request = new ListReleasesRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListReleases',
- $optionalArgs,
- ListReleasesResponse::class,
- $request
- );
- }
-
- /**
- * Lists Rollouts in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listRollouts($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listRollouts($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The `Release` which owns this collection of `Rollout` objects.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Optional. Filter rollouts to be returned. See https://google.aip.dev/160
- * for more details.
- * @type string $orderBy
- * Optional. Field to sort by. See https://google.aip.dev/132#ordering for
- * more details.
- * @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
- */
- public function listRollouts($parent, array $optionalArgs = [])
- {
- $request = new ListRolloutsRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListRollouts',
- $optionalArgs,
- ListRolloutsResponse::class,
- $request
- );
- }
-
- /**
- * Lists Targets in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]');
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listTargets($formattedParent);
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listTargets($formattedParent);
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $parent Required. The parent, which owns this collection of targets. Format must be
- * `projects/{project_id}/locations/{location_name}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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 $filter
- * Optional. Filter targets to be returned. See https://google.aip.dev/160 for
- * more details.
- * @type string $orderBy
- * Optional. Field to sort by. See https://google.aip.dev/132#ordering for
- * more details.
- * @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
- */
- public function listTargets($parent, array $optionalArgs = [])
- {
- $request = new ListTargetsRequest();
- $requestParamHeaders = [];
- $request->setParent($parent);
- $requestParamHeaders['parent'] = $parent;
- if (isset($optionalArgs['pageSize'])) {
- $request->setPageSize($optionalArgs['pageSize']);
- }
-
- if (isset($optionalArgs['pageToken'])) {
- $request->setPageToken($optionalArgs['pageToken']);
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- if (isset($optionalArgs['orderBy'])) {
- $request->setOrderBy($optionalArgs['orderBy']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->getPagedListResponse(
- 'ListTargets',
- $optionalArgs,
- ListTargetsResponse::class,
- $request
- );
- }
-
- /**
- * Retries the specified Job in a Rollout.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedRollout = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- * $phaseId = 'phase_id';
- * $jobId = 'job_id';
- * $response = $cloudDeployClient->retryJob($formattedRollout, $phaseId, $jobId);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $rollout Required. Name of the Rollout. Format is
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
- * @param string $phaseId Required. The phase ID the Job to retry belongs to.
- * @param string $jobId Required. The job ID for the Job to retry.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\RetryJobResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function retryJob(
- $rollout,
- $phaseId,
- $jobId,
- array $optionalArgs = []
- ) {
- $request = new RetryJobRequest();
- $requestParamHeaders = [];
- $request->setRollout($rollout);
- $request->setPhaseId($phaseId);
- $request->setJobId($jobId);
- $requestParamHeaders['rollout'] = $rollout;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'RetryJob',
- RetryJobResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Creates a `Rollout` to roll back the specified target.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- * $targetId = 'target_id';
- * $rolloutId = 'rollout_id';
- * $response = $cloudDeployClient->rollbackTarget($formattedName, $targetId, $rolloutId);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` should be
- * created. Format should be
- * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
- * @param string $targetId Required. ID of the `Target` that is being rolled back.
- * @param string $rolloutId Required. ID of the rollback `Rollout` to create.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $releaseId
- * Optional. ID of the `Release` to roll back to. If this isn't specified, the
- * previous successful `Rollout` to the specified target will be used to
- * determine the `Release`.
- * @type string $rolloutToRollBack
- * Optional. If provided, this must be the latest `Rollout` that is on the
- * `Target`.
- * @type RollbackTargetConfig $rollbackConfig
- * Optional. Configs for the rollback `Rollout`.
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with a `RollbackTargetResponse`.
- * @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\Deploy\V1\RollbackTargetResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function rollbackTarget(
- $name,
- $targetId,
- $rolloutId,
- array $optionalArgs = []
- ) {
- $request = new RollbackTargetRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $request->setTargetId($targetId);
- $request->setRolloutId($rolloutId);
- $requestParamHeaders['name'] = $name;
- if (isset($optionalArgs['releaseId'])) {
- $request->setReleaseId($optionalArgs['releaseId']);
- }
-
- if (isset($optionalArgs['rolloutToRollBack'])) {
- $request->setRolloutToRollBack($optionalArgs['rolloutToRollBack']);
- }
-
- if (isset($optionalArgs['rollbackConfig'])) {
- $request->setRollbackConfig($optionalArgs['rollbackConfig']);
- }
-
- 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(
- 'RollbackTarget',
- RollbackTargetResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Terminates a Job Run in a given project and location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $formattedName = $cloudDeployClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- * $response = $cloudDeployClient->terminateJobRun($formattedName);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $name Required. Name of the `JobRun`. Format must be
- * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Deploy\V1\TerminateJobRunResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function terminateJobRun($name, array $optionalArgs = [])
- {
- $request = new TerminateJobRunRequest();
- $requestParamHeaders = [];
- $request->setName($name);
- $requestParamHeaders['name'] = $name;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'TerminateJobRun',
- TerminateJobRunResponse::class,
- $optionalArgs,
- $request
- )->wait();
- }
-
- /**
- * Updates the parameters of a single Automation resource.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $updateMask = new FieldMask();
- * $automation = new Automation();
- * $operationResponse = $cloudDeployClient->updateAutomation($updateMask, $automation);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->updateAutomation($updateMask, $automation);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateAutomation');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the
- * `Automation` resource by the update.
- * The fields specified in the update_mask are relative to the resource, not
- * the full request. A field will be overwritten if it's in the mask. If the
- * user doesn't provide a mask then all fields are overwritten.
- * @param Automation $automation Required. The `Automation` to update.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, updating a `Automation` that does not exist will
- * result in the creation of a new `Automation`.
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function updateAutomation(
- $updateMask,
- $automation,
- array $optionalArgs = []
- ) {
- $request = new UpdateAutomationRequest();
- $requestParamHeaders = [];
- $request->setUpdateMask($updateMask);
- $request->setAutomation($automation);
- $requestParamHeaders['automation.name'] = $automation->getName();
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- 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->startOperationsCall(
- 'UpdateAutomation',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Updates a single CustomTargetType.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $updateMask = new FieldMask();
- * $customTargetType = new CustomTargetType();
- * $operationResponse = $cloudDeployClient->updateCustomTargetType($updateMask, $customTargetType);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->updateCustomTargetType($updateMask, $customTargetType);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateCustomTargetType');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the
- * `CustomTargetType` resource by the update.
- * The fields specified in the update_mask are relative to the resource, not
- * the full request. A field will be overwritten if it's in the mask. If the
- * user doesn't provide a mask then all fields are overwritten.
- * @param CustomTargetType $customTargetType Required. The `CustomTargetType` to update.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, updating a `CustomTargetType` that does not exist
- * will result in the creation of a new `CustomTargetType`.
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function updateCustomTargetType(
- $updateMask,
- $customTargetType,
- array $optionalArgs = []
- ) {
- $request = new UpdateCustomTargetTypeRequest();
- $requestParamHeaders = [];
- $request->setUpdateMask($updateMask);
- $request->setCustomTargetType($customTargetType);
- $requestParamHeaders[
- 'custom_target_type.name'
- ] = $customTargetType->getName();
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- 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->startOperationsCall(
- 'UpdateCustomTargetType',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Updates the parameters of a single DeliveryPipeline.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $updateMask = new FieldMask();
- * $deliveryPipeline = new DeliveryPipeline();
- * $operationResponse = $cloudDeployClient->updateDeliveryPipeline($updateMask, $deliveryPipeline);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->updateDeliveryPipeline($updateMask, $deliveryPipeline);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateDeliveryPipeline');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the
- * `DeliveryPipeline` resource by the update.
- * The fields specified in the update_mask are relative to the resource, not
- * the full request. A field will be overwritten if it's in the mask. If the
- * user doesn't provide a mask then all fields are overwritten.
- * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to update.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, updating a `DeliveryPipeline` that does not exist
- * will result in the creation of a new `DeliveryPipeline`.
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function updateDeliveryPipeline(
- $updateMask,
- $deliveryPipeline,
- array $optionalArgs = []
- ) {
- $request = new UpdateDeliveryPipelineRequest();
- $requestParamHeaders = [];
- $request->setUpdateMask($updateMask);
- $request->setDeliveryPipeline($deliveryPipeline);
- $requestParamHeaders[
- 'delivery_pipeline.name'
- ] = $deliveryPipeline->getName();
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- 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->startOperationsCall(
- 'UpdateDeliveryPipeline',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Updates the parameters of a single Target.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $updateMask = new FieldMask();
- * $target = new Target();
- * $operationResponse = $cloudDeployClient->updateTarget($updateMask, $target);
- * $operationResponse->pollUntilComplete();
- * if ($operationResponse->operationSucceeded()) {
- * $result = $operationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $operationResponse->getError();
- * // handleError($error)
- * }
- * // Alternatively:
- * // start the operation, keep the operation name, and resume later
- * $operationResponse = $cloudDeployClient->updateTarget($updateMask, $target);
- * $operationName = $operationResponse->getName();
- * // ... do other work
- * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateTarget');
- * while (!$newOperationResponse->isDone()) {
- * // ... do other work
- * $newOperationResponse->reload();
- * }
- * if ($newOperationResponse->operationSucceeded()) {
- * $result = $newOperationResponse->getResult();
- * // doSomethingWith($result)
- * } else {
- * $error = $newOperationResponse->getError();
- * // handleError($error)
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the
- * Target resource by the update.
- * The fields specified in the update_mask are relative to the resource, not
- * the full request. A field will be overwritten if it's in the mask. If the
- * user doesn't provide a mask then all fields are overwritten.
- * @param Target $target Required. The `Target` to update.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $requestId
- * Optional. A request ID to identify requests. Specify a unique request ID
- * so that if you must retry your request, the server knows to ignore the
- * request if it has already been completed. The server guarantees that for
- * at least 60 minutes after the first request.
- *
- * For example, consider a situation where you make an initial request and the
- * request times out. If you make the request again with the same request ID,
- * the server can check if original operation with the same request ID was
- * received, and if so, will ignore the second request. This prevents clients
- * from accidentally creating duplicate commitments.
- *
- * The request ID must be a valid UUID with the exception that zero UUID is
- * not supported (00000000-0000-0000-0000-000000000000).
- * @type bool $allowMissing
- * Optional. If set to true, updating a `Target` that does not exist will
- * result in the creation of a new `Target`.
- * @type bool $validateOnly
- * Optional. If set to true, the request is validated and the user is provided
- * with an expected result, but no actual change is made.
- * @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\OperationResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function updateTarget($updateMask, $target, array $optionalArgs = [])
- {
- $request = new UpdateTargetRequest();
- $requestParamHeaders = [];
- $request->setUpdateMask($updateMask);
- $request->setTarget($target);
- $requestParamHeaders['target.name'] = $target->getName();
- if (isset($optionalArgs['requestId'])) {
- $request->setRequestId($optionalArgs['requestId']);
- }
-
- if (isset($optionalArgs['allowMissing'])) {
- $request->setAllowMissing($optionalArgs['allowMissing']);
- }
-
- 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->startOperationsCall(
- 'UpdateTarget',
- $optionalArgs,
- $request,
- $this->getOperationsClient()
- )->wait();
- }
-
- /**
- * Gets information about a location.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $response = $cloudDeployClient->getLocation();
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $name
- * Resource name for the location.
- * @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\Location\Location
- *
- * @throws ApiException if the remote call fails
- */
- public function getLocation(array $optionalArgs = [])
- {
- $request = new GetLocationRequest();
- $requestParamHeaders = [];
- if (isset($optionalArgs['name'])) {
- $request->setName($optionalArgs['name']);
- $requestParamHeaders['name'] = $optionalArgs['name'];
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetLocation',
- Location::class,
- $optionalArgs,
- $request,
- Call::UNARY_CALL,
- 'google.cloud.location.Locations'
- )->wait();
- }
-
- /**
- * Lists information about the supported locations for this service.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * // Iterate over pages of elements
- * $pagedResponse = $cloudDeployClient->listLocations();
- * foreach ($pagedResponse->iteratePages() as $page) {
- * foreach ($page as $element) {
- * // doSomethingWith($element);
- * }
- * }
- * // Alternatively:
- * // Iterate through all elements
- * $pagedResponse = $cloudDeployClient->listLocations();
- * foreach ($pagedResponse->iterateAllElements() as $element) {
- * // doSomethingWith($element);
- * }
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param array $optionalArgs {
- * Optional.
- *
- * @type string $name
- * The resource that owns the locations collection, if applicable.
- * @type string $filter
- * The standard list filter.
- * @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
- */
- public function listLocations(array $optionalArgs = [])
- {
- $request = new ListLocationsRequest();
- $requestParamHeaders = [];
- if (isset($optionalArgs['name'])) {
- $request->setName($optionalArgs['name']);
- $requestParamHeaders['name'] = $optionalArgs['name'];
- }
-
- if (isset($optionalArgs['filter'])) {
- $request->setFilter($optionalArgs['filter']);
- }
-
- 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(
- 'ListLocations',
- $optionalArgs,
- ListLocationsResponse::class,
- $request,
- 'google.cloud.location.Locations'
- );
- }
-
- /**
- * Gets the access control policy for a resource. Returns an empty policy
- if the resource exists and does not have a policy set.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $resource = 'resource';
- * $response = $cloudDeployClient->getIamPolicy($resource);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $resource REQUIRED: The resource for which the policy is being requested.
- * See the operation documentation for the appropriate value for this field.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type GetPolicyOptions $options
- * OPTIONAL: A `GetPolicyOptions` object for specifying options to
- * `GetIamPolicy`.
- * @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\Iam\V1\Policy
- *
- * @throws ApiException if the remote call fails
- */
- public function getIamPolicy($resource, array $optionalArgs = [])
- {
- $request = new GetIamPolicyRequest();
- $requestParamHeaders = [];
- $request->setResource($resource);
- $requestParamHeaders['resource'] = $resource;
- if (isset($optionalArgs['options'])) {
- $request->setOptions($optionalArgs['options']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'GetIamPolicy',
- Policy::class,
- $optionalArgs,
- $request,
- Call::UNARY_CALL,
- 'google.iam.v1.IAMPolicy'
- )->wait();
- }
-
- /**
- * Sets the access control policy on the specified resource. Replaces
- any existing policy.
-
- Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
- errors.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $resource = 'resource';
- * $policy = new Policy();
- * $response = $cloudDeployClient->setIamPolicy($resource, $policy);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $resource REQUIRED: The resource for which the policy is being specified.
- * See the operation documentation for the appropriate value for this field.
- * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of
- * the policy is limited to a few 10s of KB. An empty policy is a
- * valid policy but certain Cloud Platform services (such as Projects)
- * might reject them.
- * @param array $optionalArgs {
- * Optional.
- *
- * @type FieldMask $updateMask
- * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
- * the fields in the mask will be modified. If no mask is provided, the
- * following default mask is used:
- *
- * `paths: "bindings, etag"`
- * @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\Iam\V1\Policy
- *
- * @throws ApiException if the remote call fails
- */
- public function setIamPolicy($resource, $policy, array $optionalArgs = [])
- {
- $request = new SetIamPolicyRequest();
- $requestParamHeaders = [];
- $request->setResource($resource);
- $request->setPolicy($policy);
- $requestParamHeaders['resource'] = $resource;
- if (isset($optionalArgs['updateMask'])) {
- $request->setUpdateMask($optionalArgs['updateMask']);
- }
-
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'SetIamPolicy',
- Policy::class,
- $optionalArgs,
- $request,
- Call::UNARY_CALL,
- 'google.iam.v1.IAMPolicy'
- )->wait();
- }
-
- /**
- * Returns permissions that a caller has on the specified resource. If the
- resource does not exist, this will return an empty set of
- permissions, not a `NOT_FOUND` error.
-
- Note: This operation is designed to be used for building
- permission-aware UIs and command-line tools, not for authorization
- checking. This operation may "fail open" without warning.
- *
- * Sample code:
- * ```
- * $cloudDeployClient = new CloudDeployClient();
- * try {
- * $resource = 'resource';
- * $permissions = [];
- * $response = $cloudDeployClient->testIamPermissions($resource, $permissions);
- * } finally {
- * $cloudDeployClient->close();
- * }
- * ```
- *
- * @param string $resource REQUIRED: The resource for which the policy detail is being requested.
- * See the operation documentation for the appropriate value for this field.
- * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with
- * wildcards (such as '*' or 'storage.*') are not allowed. For more
- * information see
- * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
- * @param array $optionalArgs {
- * Optional.
- *
- * @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\Iam\V1\TestIamPermissionsResponse
- *
- * @throws ApiException if the remote call fails
- */
- public function testIamPermissions(
- $resource,
- $permissions,
- array $optionalArgs = []
- ) {
- $request = new TestIamPermissionsRequest();
- $requestParamHeaders = [];
- $request->setResource($resource);
- $request->setPermissions($permissions);
- $requestParamHeaders['resource'] = $resource;
- $requestParams = new RequestParamsHeaderDescriptor(
- $requestParamHeaders
- );
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
- return $this->startCall(
- 'TestIamPermissions',
- TestIamPermissionsResponse::class,
- $optionalArgs,
- $request,
- Call::UNARY_CALL,
- 'google.iam.v1.IAMPolicy'
- )->wait();
- }
-}
diff --git a/Deploy/src/V1/GetAutomationRequest.php b/Deploy/src/V1/GetAutomationRequest.php
index fdea3420dc9e..f124bb5f99e0 100644
--- a/Deploy/src/V1/GetAutomationRequest.php
+++ b/Deploy/src/V1/GetAutomationRequest.php
@@ -21,7 +21,7 @@ class GetAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `Automation`. Format must be
diff --git a/Deploy/src/V1/GetAutomationRunRequest.php b/Deploy/src/V1/GetAutomationRunRequest.php
index d249b14ceb1a..015abd5ea426 100644
--- a/Deploy/src/V1/GetAutomationRunRequest.php
+++ b/Deploy/src/V1/GetAutomationRunRequest.php
@@ -21,7 +21,7 @@ class GetAutomationRunRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `AutomationRun`. Format must be
diff --git a/Deploy/src/V1/GetConfigRequest.php b/Deploy/src/V1/GetConfigRequest.php
index ea1950297147..affb901f5728 100644
--- a/Deploy/src/V1/GetConfigRequest.php
+++ b/Deploy/src/V1/GetConfigRequest.php
@@ -20,7 +20,7 @@ class GetConfigRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of requested configuration. Please see
diff --git a/Deploy/src/V1/GetCustomTargetTypeRequest.php b/Deploy/src/V1/GetCustomTargetTypeRequest.php
index ac2e47d24ba2..6ebe118b5a26 100644
--- a/Deploy/src/V1/GetCustomTargetTypeRequest.php
+++ b/Deploy/src/V1/GetCustomTargetTypeRequest.php
@@ -21,7 +21,7 @@ class GetCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `CustomTargetType`. Format must be
diff --git a/Deploy/src/V1/GetDeliveryPipelineRequest.php b/Deploy/src/V1/GetDeliveryPipelineRequest.php
index 3e22baeb615b..739f790fa5f3 100644
--- a/Deploy/src/V1/GetDeliveryPipelineRequest.php
+++ b/Deploy/src/V1/GetDeliveryPipelineRequest.php
@@ -21,7 +21,7 @@ class GetDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `DeliveryPipeline`. Format must be
diff --git a/Deploy/src/V1/GetJobRunRequest.php b/Deploy/src/V1/GetJobRunRequest.php
index 1f4e58266c18..8e935669dd16 100644
--- a/Deploy/src/V1/GetJobRunRequest.php
+++ b/Deploy/src/V1/GetJobRunRequest.php
@@ -21,7 +21,7 @@ class GetJobRunRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `JobRun`. Format must be
diff --git a/Deploy/src/V1/GetReleaseRequest.php b/Deploy/src/V1/GetReleaseRequest.php
index ebb3240557cc..ee0d72b371ac 100644
--- a/Deploy/src/V1/GetReleaseRequest.php
+++ b/Deploy/src/V1/GetReleaseRequest.php
@@ -21,7 +21,7 @@ class GetReleaseRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `Release`. Format must be
diff --git a/Deploy/src/V1/GetRolloutRequest.php b/Deploy/src/V1/GetRolloutRequest.php
index 536e7371abe8..9ff5d3af52af 100644
--- a/Deploy/src/V1/GetRolloutRequest.php
+++ b/Deploy/src/V1/GetRolloutRequest.php
@@ -21,7 +21,7 @@ class GetRolloutRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `Rollout`. Format must be
diff --git a/Deploy/src/V1/GetTargetRequest.php b/Deploy/src/V1/GetTargetRequest.php
index ec237d10e015..e88f8c170dd1 100644
--- a/Deploy/src/V1/GetTargetRequest.php
+++ b/Deploy/src/V1/GetTargetRequest.php
@@ -21,7 +21,7 @@ class GetTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `Target`. Format must be
diff --git a/Deploy/src/V1/GkeCluster.php b/Deploy/src/V1/GkeCluster.php
index b28fe7fad7fb..0f11f604a390 100644
--- a/Deploy/src/V1/GkeCluster.php
+++ b/Deploy/src/V1/GkeCluster.php
@@ -21,7 +21,7 @@ class GkeCluster extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {
*/
- private $cluster = '';
+ protected $cluster = '';
/**
* Optional. If true, `cluster` is accessed using the private IP address of
* the control plane endpoint. Otherwise, the default IP address of the
@@ -33,7 +33,7 @@ class GkeCluster extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool internal_ip = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $internal_ip = false;
+ protected $internal_ip = false;
/**
* Constructor.
diff --git a/Deploy/src/V1/IgnoreJobRequest.php b/Deploy/src/V1/IgnoreJobRequest.php
index 0a4ea21c773f..094701d85774 100644
--- a/Deploy/src/V1/IgnoreJobRequest.php
+++ b/Deploy/src/V1/IgnoreJobRequest.php
@@ -21,19 +21,19 @@ class IgnoreJobRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Required. The phase ID the Job to ignore belongs to.
*
* Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $phase_id = '';
+ protected $phase_id = '';
/**
* Required. The job ID for the Job to ignore.
*
* Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $job_id = '';
+ protected $job_id = '';
/**
* @param string $rollout Required. Name of the Rollout. Format is
diff --git a/Deploy/src/V1/Job.php b/Deploy/src/V1/Job.php
index 73f7c9ba2357..894b8658f331 100644
--- a/Deploy/src/V1/Job.php
+++ b/Deploy/src/V1/Job.php
@@ -20,27 +20,27 @@ class Job extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $id = '';
+ protected $id = '';
/**
* Output only. The current state of the Job.
*
* Generated from protobuf field .google.cloud.deploy.v1.Job.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. Additional information on why the Job was skipped, if
* available.
*
* Generated from protobuf field string skip_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $skip_message = '';
+ protected $skip_message = '';
/**
* Output only. The name of the `JobRun` responsible for the most recent
* invocation of this Job.
*
* Generated from protobuf field string job_run = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $job_run = '';
+ protected $job_run = '';
protected $job_type;
/**
diff --git a/Deploy/src/V1/JobRun.php b/Deploy/src/V1/JobRun.php
index 81075e3d4705..2a9a5fa9bc5e 100644
--- a/Deploy/src/V1/JobRun.php
+++ b/Deploy/src/V1/JobRun.php
@@ -22,49 +22,49 @@ class JobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Unique identifier of the `JobRun`.
*
* Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Output only. ID of the `Rollout` phase this `JobRun` belongs in.
*
* Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $phase_id = '';
+ protected $phase_id = '';
/**
* Output only. ID of the `Rollout` job this `JobRun` corresponds to.
*
* Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $job_id = '';
+ protected $job_id = '';
/**
* Output only. Time at which the `JobRun` was created.
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Time at which the `JobRun` was started.
*
* Generated from protobuf field .google.protobuf.Timestamp start_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $start_time = null;
+ protected $start_time = null;
/**
* Output only. Time at which the `JobRun` ended.
*
* Generated from protobuf field .google.protobuf.Timestamp end_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $end_time = null;
+ protected $end_time = null;
/**
* Output only. The current state of the `JobRun`.
*
* Generated from protobuf field .google.cloud.deploy.v1.JobRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. This checksum is computed by the server based on the value of
* other fields, and may be sent on update and delete requests to ensure the
@@ -72,7 +72,7 @@ class JobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $etag = '';
+ protected $etag = '';
protected $job_run;
/**
diff --git a/Deploy/src/V1/JobRunNotificationEvent.php b/Deploy/src/V1/JobRunNotificationEvent.php
index d83c49258583..74416dde71d6 100644
--- a/Deploy/src/V1/JobRunNotificationEvent.php
+++ b/Deploy/src/V1/JobRunNotificationEvent.php
@@ -22,55 +22,55 @@ class JobRunNotificationEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* The name of the `JobRun`.
*
* Generated from protobuf field string job_run = 2;
*/
- private $job_run = '';
+ protected $job_run = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 3;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* Unique identifier of the `Release`.
*
* Generated from protobuf field string release_uid = 4;
*/
- private $release_uid = '';
+ protected $release_uid = '';
/**
* The name of the `Release`.
*
* Generated from protobuf field string release = 8;
*/
- private $release = '';
+ protected $release = '';
/**
* Unique identifier of the `Rollout`.
*
* Generated from protobuf field string rollout_uid = 5;
*/
- private $rollout_uid = '';
+ protected $rollout_uid = '';
/**
* The name of the `Rollout`.
*
* Generated from protobuf field string rollout = 9;
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* ID of the `Target`.
*
* Generated from protobuf field string target_id = 6;
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 7;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php b/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php
index 0fb2e6896efd..7baf6775224c 100644
--- a/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php
+++ b/Deploy/src/V1/KubernetesConfig/GatewayServiceMesh.php
@@ -20,20 +20,20 @@ class GatewayServiceMesh extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string http_route = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $http_route = '';
+ protected $http_route = '';
/**
* Required. Name of the Kubernetes Service.
*
* Generated from protobuf field string service = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $service = '';
+ protected $service = '';
/**
* Required. Name of the Kubernetes Deployment whose traffic is managed by
* the specified HTTPRoute and Service.
*
* Generated from protobuf field string deployment = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $deployment = '';
+ protected $deployment = '';
/**
* Optional. The time to wait for route updates to propagate. The maximum
* configurable time is 3 hours, in seconds format. If unspecified, there is
@@ -41,7 +41,7 @@ class GatewayServiceMesh extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Duration route_update_wait_time = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $route_update_wait_time = null;
+ protected $route_update_wait_time = null;
/**
* Optional. The amount of time to migrate traffic back from the canary
* Service to the original Service during the stable phase deployment. If
@@ -50,7 +50,7 @@ class GatewayServiceMesh extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Duration stable_cutback_duration = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $stable_cutback_duration = null;
+ protected $stable_cutback_duration = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php b/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php
index 538d4e39b8f5..1313dae9edc2 100644
--- a/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php
+++ b/Deploy/src/V1/KubernetesConfig/ServiceNetworking.php
@@ -20,14 +20,14 @@ class ServiceNetworking extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $service = '';
+ protected $service = '';
/**
* Required. Name of the Kubernetes Deployment whose traffic is managed by
* the specified Service.
*
* Generated from protobuf field string deployment = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $deployment = '';
+ protected $deployment = '';
/**
* Optional. Whether to disable Pod overprovisioning. If Pod
* overprovisioning is disabled then Cloud Deploy will limit the number of
@@ -36,7 +36,7 @@ class ServiceNetworking extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool disable_pod_overprovisioning = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $disable_pod_overprovisioning = false;
+ protected $disable_pod_overprovisioning = false;
/**
* Constructor.
diff --git a/Deploy/src/V1/ListAutomationRunsRequest.php b/Deploy/src/V1/ListAutomationRunsRequest.php
index a3ae72348594..de808a00b4a8 100644
--- a/Deploy/src/V1/ListAutomationRunsRequest.php
+++ b/Deploy/src/V1/ListAutomationRunsRequest.php
@@ -22,7 +22,7 @@ class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* The maximum number of automationRuns to return. The service may return
* fewer than this value. If unspecified, at most 50 automationRuns will
@@ -31,7 +31,7 @@ class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2;
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* A page token, received from a previous `ListAutomationRuns` call.
* Provide this to retrieve the subsequent page.
@@ -40,20 +40,20 @@ class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3;
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Filter automationRuns to be returned. All fields can be used in the
* filter.
*
* Generated from protobuf field string filter = 4;
*/
- private $filter = '';
+ protected $filter = '';
/**
* Field to sort by.
*
* Generated from protobuf field string order_by = 5;
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of
diff --git a/Deploy/src/V1/ListAutomationRunsResponse.php b/Deploy/src/V1/ListAutomationRunsResponse.php
index 22af1ab166a8..9a672c0fe1de 100644
--- a/Deploy/src/V1/ListAutomationRunsResponse.php
+++ b/Deploy/src/V1/ListAutomationRunsResponse.php
@@ -27,7 +27,7 @@ class ListAutomationRunsResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/ListAutomationsRequest.php b/Deploy/src/V1/ListAutomationsRequest.php
index ea78b76f57e4..beacb32f80d0 100644
--- a/Deploy/src/V1/ListAutomationsRequest.php
+++ b/Deploy/src/V1/ListAutomationsRequest.php
@@ -22,7 +22,7 @@ class ListAutomationsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* The maximum number of automations to return. The service may return
* fewer than this value. If unspecified, at most 50 automations will
@@ -31,7 +31,7 @@ class ListAutomationsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2;
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* A page token, received from a previous `ListAutomations` call.
* Provide this to retrieve the subsequent page.
@@ -40,20 +40,20 @@ class ListAutomationsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3;
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Filter automations to be returned. All fields can be used in the
* filter.
*
* Generated from protobuf field string filter = 4;
*/
- private $filter = '';
+ protected $filter = '';
/**
* Field to sort by.
*
* Generated from protobuf field string order_by = 5;
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The parent `Delivery Pipeline`, which owns this collection of
diff --git a/Deploy/src/V1/ListAutomationsResponse.php b/Deploy/src/V1/ListAutomationsResponse.php
index 2324679b199a..c14853d6404e 100644
--- a/Deploy/src/V1/ListAutomationsResponse.php
+++ b/Deploy/src/V1/ListAutomationsResponse.php
@@ -27,7 +27,7 @@ class ListAutomationsResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/ListCustomTargetTypesRequest.php b/Deploy/src/V1/ListCustomTargetTypesRequest.php
index e3fc24453112..375fe11940d1 100644
--- a/Deploy/src/V1/ListCustomTargetTypesRequest.php
+++ b/Deploy/src/V1/ListCustomTargetTypesRequest.php
@@ -21,7 +21,7 @@ class ListCustomTargetTypesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Optional. The maximum number of `CustomTargetType` objects to return. The
* service may return fewer than this value. If unspecified, at most 50
@@ -30,7 +30,7 @@ class ListCustomTargetTypesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* Optional. A page token, received from a previous `ListCustomTargetTypes`
* call. Provide this to retrieve the subsequent page.
@@ -39,21 +39,21 @@ class ListCustomTargetTypesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Optional. Filter custom target types to be returned. See
* https://google.aip.dev/160 for more details.
*
* Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $filter = '';
+ protected $filter = '';
/**
* Optional. Field to sort by. See https://google.aip.dev/132#ordering for
* more details.
*
* Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The parent that owns this collection of custom target types.
diff --git a/Deploy/src/V1/ListCustomTargetTypesResponse.php b/Deploy/src/V1/ListCustomTargetTypesResponse.php
index c563126a42f5..0b7aed0e438f 100644
--- a/Deploy/src/V1/ListCustomTargetTypesResponse.php
+++ b/Deploy/src/V1/ListCustomTargetTypesResponse.php
@@ -27,7 +27,7 @@ class ListCustomTargetTypesResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/ListDeliveryPipelinesRequest.php b/Deploy/src/V1/ListDeliveryPipelinesRequest.php
index ef072380dab0..5718d4cb4190 100644
--- a/Deploy/src/V1/ListDeliveryPipelinesRequest.php
+++ b/Deploy/src/V1/ListDeliveryPipelinesRequest.php
@@ -21,7 +21,7 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* The maximum number of pipelines to return. The service may return
* fewer than this value. If unspecified, at most 50 pipelines will
@@ -30,7 +30,7 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2;
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* A page token, received from a previous `ListDeliveryPipelines` call.
* Provide this to retrieve the subsequent page.
@@ -39,20 +39,20 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3;
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Filter pipelines to be returned. See https://google.aip.dev/160 for more
* details.
*
* Generated from protobuf field string filter = 4;
*/
- private $filter = '';
+ protected $filter = '';
/**
* Field to sort by. See https://google.aip.dev/132#ordering for more details.
*
* Generated from protobuf field string order_by = 5;
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The parent, which owns this collection of pipelines. Format must
diff --git a/Deploy/src/V1/ListDeliveryPipelinesResponse.php b/Deploy/src/V1/ListDeliveryPipelinesResponse.php
index ab3b6f0a737e..aade7781c825 100644
--- a/Deploy/src/V1/ListDeliveryPipelinesResponse.php
+++ b/Deploy/src/V1/ListDeliveryPipelinesResponse.php
@@ -27,7 +27,7 @@ class ListDeliveryPipelinesResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/ListJobRunsRequest.php b/Deploy/src/V1/ListJobRunsRequest.php
index c6c362305fc1..de678b046e48 100644
--- a/Deploy/src/V1/ListJobRunsRequest.php
+++ b/Deploy/src/V1/ListJobRunsRequest.php
@@ -20,7 +20,7 @@ class ListJobRunsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Optional. The maximum number of `JobRun` objects to return. The service may
* return fewer than this value. If unspecified, at most 50 `JobRun` objects
@@ -29,7 +29,7 @@ class ListJobRunsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* Optional. A page token, received from a previous `ListJobRuns` call.
* Provide this to retrieve the subsequent page.
@@ -38,21 +38,21 @@ class ListJobRunsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Optional. Filter results to be returned. See https://google.aip.dev/160 for
* more details.
*
* Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $filter = '';
+ protected $filter = '';
/**
* Optional. Field to sort by. See https://google.aip.dev/132#ordering for
* more details.
*
* Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The `Rollout` which owns this collection of `JobRun` objects. Please see
diff --git a/Deploy/src/V1/ListJobRunsResponse.php b/Deploy/src/V1/ListJobRunsResponse.php
index 0596be48edbf..c62986ce2dbe 100644
--- a/Deploy/src/V1/ListJobRunsResponse.php
+++ b/Deploy/src/V1/ListJobRunsResponse.php
@@ -27,7 +27,7 @@ class ListJobRunsResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached
*
diff --git a/Deploy/src/V1/ListReleasesRequest.php b/Deploy/src/V1/ListReleasesRequest.php
index 25c4de06de60..a133cfc5e498 100644
--- a/Deploy/src/V1/ListReleasesRequest.php
+++ b/Deploy/src/V1/ListReleasesRequest.php
@@ -21,7 +21,7 @@ class ListReleasesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Optional. The maximum number of `Release` objects to return. The service
* may return fewer than this value. If unspecified, at most 50 `Release`
@@ -30,7 +30,7 @@ class ListReleasesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* Optional. A page token, received from a previous `ListReleases` call.
* Provide this to retrieve the subsequent page.
@@ -39,21 +39,21 @@ class ListReleasesRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Optional. Filter releases to be returned. See https://google.aip.dev/160
* for more details.
*
* Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $filter = '';
+ protected $filter = '';
/**
* Optional. Field to sort by. See https://google.aip.dev/132#ordering for
* more details.
*
* Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The `DeliveryPipeline` which owns this collection of `Release`
diff --git a/Deploy/src/V1/ListReleasesResponse.php b/Deploy/src/V1/ListReleasesResponse.php
index ee6fe0f5a05f..72798b69fe4c 100644
--- a/Deploy/src/V1/ListReleasesResponse.php
+++ b/Deploy/src/V1/ListReleasesResponse.php
@@ -27,7 +27,7 @@ class ListReleasesResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/ListRolloutsRequest.php b/Deploy/src/V1/ListRolloutsRequest.php
index 9b2536e10068..6209b04be8b5 100644
--- a/Deploy/src/V1/ListRolloutsRequest.php
+++ b/Deploy/src/V1/ListRolloutsRequest.php
@@ -20,7 +20,7 @@ class ListRolloutsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Optional. The maximum number of `Rollout` objects to return. The service
* may return fewer than this value. If unspecified, at most 50 `Rollout`
@@ -29,7 +29,7 @@ class ListRolloutsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* Optional. A page token, received from a previous `ListRollouts` call.
* Provide this to retrieve the subsequent page.
@@ -38,21 +38,21 @@ class ListRolloutsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Optional. Filter rollouts to be returned. See https://google.aip.dev/160
* for more details.
*
* Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $filter = '';
+ protected $filter = '';
/**
* Optional. Field to sort by. See https://google.aip.dev/132#ordering for
* more details.
*
* Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The `Release` which owns this collection of `Rollout` objects. Please see
diff --git a/Deploy/src/V1/ListRolloutsResponse.php b/Deploy/src/V1/ListRolloutsResponse.php
index 28ded1c2b0bf..fc25e3092666 100644
--- a/Deploy/src/V1/ListRolloutsResponse.php
+++ b/Deploy/src/V1/ListRolloutsResponse.php
@@ -27,7 +27,7 @@ class ListRolloutsResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/ListTargetsRequest.php b/Deploy/src/V1/ListTargetsRequest.php
index e4add9f854e2..2aa7809d0875 100644
--- a/Deploy/src/V1/ListTargetsRequest.php
+++ b/Deploy/src/V1/ListTargetsRequest.php
@@ -21,7 +21,7 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $parent = '';
+ protected $parent = '';
/**
* Optional. The maximum number of `Target` objects to return. The service may
* return fewer than this value. If unspecified, at most 50 `Target` objects
@@ -30,7 +30,7 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_size = 0;
+ protected $page_size = 0;
/**
* Optional. A page token, received from a previous `ListTargets` call.
* Provide this to retrieve the subsequent page.
@@ -39,21 +39,21 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $page_token = '';
+ protected $page_token = '';
/**
* Optional. Filter targets to be returned. See https://google.aip.dev/160 for
* more details.
*
* Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $filter = '';
+ protected $filter = '';
/**
* Optional. Field to sort by. See https://google.aip.dev/132#ordering for
* more details.
*
* Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $order_by = '';
+ protected $order_by = '';
/**
* @param string $parent Required. The parent, which owns this collection of targets. Format must be
diff --git a/Deploy/src/V1/ListTargetsResponse.php b/Deploy/src/V1/ListTargetsResponse.php
index 329dc1ba9c44..4c648ae25fd5 100644
--- a/Deploy/src/V1/ListTargetsResponse.php
+++ b/Deploy/src/V1/ListTargetsResponse.php
@@ -27,7 +27,7 @@ class ListTargetsResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string next_page_token = 2;
*/
- private $next_page_token = '';
+ protected $next_page_token = '';
/**
* Locations that could not be reached.
*
diff --git a/Deploy/src/V1/Metadata.php b/Deploy/src/V1/Metadata.php
index 67ec6af8409a..f9940ac35423 100644
--- a/Deploy/src/V1/Metadata.php
+++ b/Deploy/src/V1/Metadata.php
@@ -21,20 +21,20 @@ class Metadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.CloudRunMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $cloud_run = null;
+ protected $cloud_run = null;
/**
* Output only. AutomationRolloutMetadata contains the information about the
* interactions between Automation service and this rollout.
*
* Generated from protobuf field .google.cloud.deploy.v1.AutomationRolloutMetadata automation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $automation = null;
+ protected $automation = null;
/**
* Output only. Custom metadata provided by user-defined `Rollout` operations.
*
* Generated from protobuf field .google.cloud.deploy.v1.CustomMetadata custom = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $custom = null;
+ protected $custom = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/OperationMetadata.php b/Deploy/src/V1/OperationMetadata.php
index fe004de04da3..2565328b1fe3 100644
--- a/Deploy/src/V1/OperationMetadata.php
+++ b/Deploy/src/V1/OperationMetadata.php
@@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. The time the operation finished running.
*
* Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $end_time = null;
+ protected $end_time = null;
/**
* Output only. Server-defined resource path for the target of the operation.
*
* Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $target = '';
+ protected $target = '';
/**
* Output only. Name of the verb executed by the operation.
*
* Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $verb = '';
+ protected $verb = '';
/**
* Output only. Human-readable status of the operation, if any.
*
* Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $status_message = '';
+ protected $status_message = '';
/**
* Output only. Identifies whether the user has requested cancellation
* of the operation. Operations that have successfully been cancelled
@@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $requested_cancellation = false;
+ protected $requested_cancellation = false;
/**
* Output only. API version used to start the operation.
*
* Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $api_version = '';
+ protected $api_version = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/Phase.php b/Deploy/src/V1/Phase.php
index 8afc379e9d21..d4eb8041827c 100644
--- a/Deploy/src/V1/Phase.php
+++ b/Deploy/src/V1/Phase.php
@@ -21,20 +21,20 @@ class Phase extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $id = '';
+ protected $id = '';
/**
* Output only. Current state of the Phase.
*
* Generated from protobuf field .google.cloud.deploy.v1.Phase.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. Additional information on why the Phase was skipped, if
* available.
*
* Generated from protobuf field string skip_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $skip_message = '';
+ protected $skip_message = '';
protected $jobs;
/**
diff --git a/Deploy/src/V1/PipelineCondition.php b/Deploy/src/V1/PipelineCondition.php
index 97eb349ce5c9..9b2a718bb204 100644
--- a/Deploy/src/V1/PipelineCondition.php
+++ b/Deploy/src/V1/PipelineCondition.php
@@ -20,20 +20,20 @@ class PipelineCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.PipelineReadyCondition pipeline_ready_condition = 1;
*/
- private $pipeline_ready_condition = null;
+ protected $pipeline_ready_condition = null;
/**
* Details around targets enumerated in the pipeline.
*
* Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 3;
*/
- private $targets_present_condition = null;
+ protected $targets_present_condition = null;
/**
* Details on the whether the targets enumerated in the pipeline are of the
* same type.
*
* Generated from protobuf field .google.cloud.deploy.v1.TargetsTypeCondition targets_type_condition = 4;
*/
- private $targets_type_condition = null;
+ protected $targets_type_condition = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/PipelineReadyCondition.php b/Deploy/src/V1/PipelineReadyCondition.php
index bd5afe48fa9f..5ed4775bcce0 100644
--- a/Deploy/src/V1/PipelineReadyCondition.php
+++ b/Deploy/src/V1/PipelineReadyCondition.php
@@ -24,13 +24,13 @@ class PipelineReadyCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool status = 3;
*/
- private $status = false;
+ protected $status = false;
/**
* Last time the condition was updated.
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 4;
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/PostdeployJobRun.php b/Deploy/src/V1/PostdeployJobRun.php
index e6e0cc7de825..1f75d56505ec 100644
--- a/Deploy/src/V1/PostdeployJobRun.php
+++ b/Deploy/src/V1/PostdeployJobRun.php
@@ -22,21 +22,21 @@ class PostdeployJobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $build = '';
+ protected $build = '';
/**
* Output only. The reason the postdeploy failed. This will always be
* unspecified while the postdeploy is in progress or if it succeeded.
*
* Generated from protobuf field .google.cloud.deploy.v1.PostdeployJobRun.FailureCause failure_cause = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_cause = 0;
+ protected $failure_cause = 0;
/**
* Output only. Additional information about the postdeploy failure, if
* available.
*
* Generated from protobuf field string failure_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_message = '';
+ protected $failure_message = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/PredeployJobRun.php b/Deploy/src/V1/PredeployJobRun.php
index 70920ef199fd..ad155d70502c 100644
--- a/Deploy/src/V1/PredeployJobRun.php
+++ b/Deploy/src/V1/PredeployJobRun.php
@@ -22,21 +22,21 @@ class PredeployJobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $build = '';
+ protected $build = '';
/**
* Output only. The reason the predeploy failed. This will always be
* unspecified while the predeploy is in progress or if it succeeded.
*
* Generated from protobuf field .google.cloud.deploy.v1.PredeployJobRun.FailureCause failure_cause = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_cause = 0;
+ protected $failure_cause = 0;
/**
* Output only. Additional information about the predeploy failure, if
* available.
*
* Generated from protobuf field string failure_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_message = '';
+ protected $failure_message = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/PrivatePool.php b/Deploy/src/V1/PrivatePool.php
index 843bf8f19acc..b7a8ae63ba44 100644
--- a/Deploy/src/V1/PrivatePool.php
+++ b/Deploy/src/V1/PrivatePool.php
@@ -21,7 +21,7 @@ class PrivatePool extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string worker_pool = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $worker_pool = '';
+ protected $worker_pool = '';
/**
* Optional. Google service account to use for execution. If unspecified,
* the project execution service account
@@ -29,7 +29,7 @@ class PrivatePool extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string service_account = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $service_account = '';
+ protected $service_account = '';
/**
* Optional. Cloud Storage location where execution outputs should be stored.
* This can either be a bucket ("gs://my-bucket") or a path within a bucket
@@ -38,7 +38,7 @@ class PrivatePool extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string artifact_storage = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $artifact_storage = '';
+ protected $artifact_storage = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/PromoteReleaseOperation.php b/Deploy/src/V1/PromoteReleaseOperation.php
index dbdc97d94eb2..5dec2ed45fe3 100644
--- a/Deploy/src/V1/PromoteReleaseOperation.php
+++ b/Deploy/src/V1/PromoteReleaseOperation.php
@@ -22,25 +22,25 @@ class PromoteReleaseOperation extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string target_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Output only. How long the operation will be paused.
*
* Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $wait = null;
+ protected $wait = null;
/**
* Output only. The name of the rollout that initiates the `AutomationRun`.
*
* Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Output only. The starting phase of the rollout created by this operation.
*
* Generated from protobuf field string phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $phase = '';
+ protected $phase = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/PromoteReleaseRule.php b/Deploy/src/V1/PromoteReleaseRule.php
index 4405b3a1f2d6..5f7bb10e599e 100644
--- a/Deploy/src/V1/PromoteReleaseRule.php
+++ b/Deploy/src/V1/PromoteReleaseRule.php
@@ -23,14 +23,14 @@ class PromoteReleaseRule extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $id = '';
+ protected $id = '';
/**
* Optional. How long the release need to be paused until being promoted to
* the next target.
*
* Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $wait = null;
+ protected $wait = null;
/**
* Optional. The ID of the stage in the pipeline to which this `Release` is
* deploying. If unspecified, default it to the next stage in the promotion
@@ -42,20 +42,20 @@ class PromoteReleaseRule extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $destination_target_id = '';
+ protected $destination_target_id = '';
/**
* Output only. Information around the state of the Automation rule.
*
* Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $condition = null;
+ protected $condition = null;
/**
* Optional. The starting phase of the rollout created by this operation.
* Default to the first phase.
*
* Generated from protobuf field string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $destination_phase = '';
+ protected $destination_phase = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/Release.php b/Deploy/src/V1/Release.php
index bf8b7e0623b6..2842c336a4e7 100644
--- a/Deploy/src/V1/Release.php
+++ b/Deploy/src/V1/Release.php
@@ -24,19 +24,19 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Unique identifier of the `Release`.
*
* Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Description of the `Release`. Max length is 255 characters.
*
* Generated from protobuf field string description = 3;
*/
- private $description = '';
+ protected $description = '';
/**
* User annotations. These attributes can only be set and used by the
* user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations
@@ -64,37 +64,37 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool abandoned = 23 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $abandoned = false;
+ protected $abandoned = false;
/**
* Output only. Time at which the `Release` was created.
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Time at which the render began.
*
* Generated from protobuf field .google.protobuf.Timestamp render_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $render_start_time = null;
+ protected $render_start_time = null;
/**
* Output only. Time at which the render completed.
*
* Generated from protobuf field .google.protobuf.Timestamp render_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $render_end_time = null;
+ protected $render_end_time = null;
/**
* Cloud Storage URI of tar.gz archive containing Skaffold configuration.
*
* Generated from protobuf field string skaffold_config_uri = 17;
*/
- private $skaffold_config_uri = '';
+ protected $skaffold_config_uri = '';
/**
* Filepath of the Skaffold config inside of the config URI.
*
* Generated from protobuf field string skaffold_config_path = 9;
*/
- private $skaffold_config_path = '';
+ protected $skaffold_config_path = '';
/**
* List of artifacts to pass through to Skaffold command.
*
@@ -107,7 +107,7 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline_snapshot = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $delivery_pipeline_snapshot = null;
+ protected $delivery_pipeline_snapshot = null;
/**
* Output only. Snapshot of the targets taken at release creation time.
*
@@ -126,7 +126,7 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState render_state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $render_state = 0;
+ protected $render_state = 0;
/**
* This checksum is computed by the server based on the value of other
* fields, and may be sent on update and delete requests to ensure the
@@ -134,7 +134,7 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 16;
*/
- private $etag = '';
+ protected $etag = '';
/**
* The Skaffold version to use when operating on this release, such as
* "1.20.0". Not all versions are valid; Cloud Deploy supports a specific set
@@ -143,7 +143,7 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string skaffold_version = 19;
*/
- private $skaffold_version = '';
+ protected $skaffold_version = '';
/**
* Output only. Map from target ID to the target artifacts created
* during the render operation.
@@ -163,7 +163,7 @@ class Release extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.ReleaseCondition condition = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $condition = null;
+ protected $condition = null;
/**
* Optional. The deploy parameters to use for all targets in this release.
*
diff --git a/Deploy/src/V1/Release/ReleaseCondition.php b/Deploy/src/V1/Release/ReleaseCondition.php
index 9c838755a6d0..15897e2b2142 100644
--- a/Deploy/src/V1/Release/ReleaseCondition.php
+++ b/Deploy/src/V1/Release/ReleaseCondition.php
@@ -20,14 +20,14 @@ class ReleaseCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.ReleaseReadyCondition release_ready_condition = 1;
*/
- private $release_ready_condition = null;
+ protected $release_ready_condition = null;
/**
* Details around the support state of the release's Skaffold
* version.
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.SkaffoldSupportedCondition skaffold_supported_condition = 2;
*/
- private $skaffold_supported_condition = null;
+ protected $skaffold_supported_condition = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/Release/ReleaseReadyCondition.php b/Deploy/src/V1/Release/ReleaseReadyCondition.php
index ebc7d6060ccc..be7fbf10f02c 100644
--- a/Deploy/src/V1/Release/ReleaseReadyCondition.php
+++ b/Deploy/src/V1/Release/ReleaseReadyCondition.php
@@ -25,7 +25,7 @@ class ReleaseReadyCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool status = 1;
*/
- private $status = false;
+ protected $status = false;
/**
* Constructor.
diff --git a/Deploy/src/V1/Release/SkaffoldSupportedCondition.php b/Deploy/src/V1/Release/SkaffoldSupportedCondition.php
index 3e5424d9a5c9..f223cf99d5e5 100644
--- a/Deploy/src/V1/Release/SkaffoldSupportedCondition.php
+++ b/Deploy/src/V1/Release/SkaffoldSupportedCondition.php
@@ -21,27 +21,27 @@ class SkaffoldSupportedCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool status = 1;
*/
- private $status = false;
+ protected $status = false;
/**
* The Skaffold support state for this release's version of Skaffold.
*
* Generated from protobuf field .google.cloud.deploy.v1.SkaffoldSupportState skaffold_support_state = 2;
*/
- private $skaffold_support_state = 0;
+ protected $skaffold_support_state = 0;
/**
* The time at which this release's version of Skaffold will enter
* maintenance mode.
*
* Generated from protobuf field .google.protobuf.Timestamp maintenance_mode_time = 3;
*/
- private $maintenance_mode_time = null;
+ protected $maintenance_mode_time = null;
/**
* The time at which this release's version of Skaffold will no longer be
* supported.
*
* Generated from protobuf field .google.protobuf.Timestamp support_expiration_time = 4;
*/
- private $support_expiration_time = null;
+ protected $support_expiration_time = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/Release/TargetRender.php b/Deploy/src/V1/Release/TargetRender.php
index bde25523fca5..f7594f1bde85 100644
--- a/Deploy/src/V1/Release/TargetRender.php
+++ b/Deploy/src/V1/Release/TargetRender.php
@@ -22,33 +22,33 @@ class TargetRender extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rendering_build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $rendering_build = '';
+ protected $rendering_build = '';
/**
* Output only. Current state of the render operation for this Target.
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.TargetRenderState rendering_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rendering_state = 0;
+ protected $rendering_state = 0;
/**
* Output only. Metadata related to the `Release` render for this Target.
*
* Generated from protobuf field .google.cloud.deploy.v1.RenderMetadata metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $metadata = null;
+ protected $metadata = null;
/**
* Output only. Reason this render failed. This will always be unspecified
* while the render in progress.
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.FailureCause failure_cause = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_cause = 0;
+ protected $failure_cause = 0;
/**
* Output only. Additional information about the render failure, if
* available.
*
* Generated from protobuf field string failure_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_message = '';
+ protected $failure_message = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/ReleaseNotificationEvent.php b/Deploy/src/V1/ReleaseNotificationEvent.php
index 81a79b826379..564707b255ce 100644
--- a/Deploy/src/V1/ReleaseNotificationEvent.php
+++ b/Deploy/src/V1/ReleaseNotificationEvent.php
@@ -22,31 +22,31 @@ class ReleaseNotificationEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 4;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* Unique identifier of the `Release`.
*
* Generated from protobuf field string release_uid = 5;
*/
- private $release_uid = '';
+ protected $release_uid = '';
/**
* The name of the `Release`.
*
* Generated from protobuf field string release = 2;
*/
- private $release = '';
+ protected $release = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 3;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/ReleaseRenderEvent.php b/Deploy/src/V1/ReleaseRenderEvent.php
index 50aedff24f50..59933d460f13 100644
--- a/Deploy/src/V1/ReleaseRenderEvent.php
+++ b/Deploy/src/V1/ReleaseRenderEvent.php
@@ -22,13 +22,13 @@ class ReleaseRenderEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 4;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* The name of the release.
* release_uid is not in this log message because we write some of these log
@@ -36,19 +36,19 @@ class ReleaseRenderEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string release = 2;
*/
- private $release = '';
+ protected $release = '';
/**
* Type of this notification, e.g. for a release render state change event.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 5;
*/
- private $type = 0;
+ protected $type = 0;
/**
* The state of the release render.
*
* Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState release_render_state = 3;
*/
- private $release_render_state = 0;
+ protected $release_render_state = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/RenderMetadata.php b/Deploy/src/V1/RenderMetadata.php
index dbb4fc56490e..a4ef9c53a1d1 100644
--- a/Deploy/src/V1/RenderMetadata.php
+++ b/Deploy/src/V1/RenderMetadata.php
@@ -20,13 +20,13 @@ class RenderMetadata extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.CloudRunRenderMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $cloud_run = null;
+ protected $cloud_run = null;
/**
* Output only. Custom metadata provided by user-defined render operation.
*
* Generated from protobuf field .google.cloud.deploy.v1.CustomMetadata custom = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $custom = null;
+ protected $custom = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/RepairRolloutOperation.php b/Deploy/src/V1/RepairRolloutOperation.php
index a991aef6f780..cbc9fa6ba97a 100644
--- a/Deploy/src/V1/RepairRolloutOperation.php
+++ b/Deploy/src/V1/RepairRolloutOperation.php
@@ -20,13 +20,13 @@ class RepairRolloutOperation extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Output only. The index of the current repair action in the repair sequence.
*
* Generated from protobuf field int64 current_repair_mode_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $current_repair_mode_index = 0;
+ protected $current_repair_mode_index = 0;
/**
* Output only. Records of the repair attempts. Each repair phase may have
* multiple retry attempts or single rollback attempt.
diff --git a/Deploy/src/V1/RepairRolloutRule.php b/Deploy/src/V1/RepairRolloutRule.php
index 9e3d1b0cde74..44a01f3f4736 100644
--- a/Deploy/src/V1/RepairRolloutRule.php
+++ b/Deploy/src/V1/RepairRolloutRule.php
@@ -23,7 +23,7 @@ class RepairRolloutRule extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $id = '';
+ protected $id = '';
/**
* Optional. Phases within which jobs are subject to automatic repair actions
* on failure. Proceeds only after phase name matched any one in the list, or
@@ -58,7 +58,7 @@ class RepairRolloutRule extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $condition = null;
+ protected $condition = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/Retry.php b/Deploy/src/V1/Retry.php
index 2c1715d4f415..75f2e79026fd 100644
--- a/Deploy/src/V1/Retry.php
+++ b/Deploy/src/V1/Retry.php
@@ -21,21 +21,21 @@ class Retry extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int64 attempts = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $attempts = 0;
+ protected $attempts = 0;
/**
* Optional. How long to wait for the first retry. Default is 0, and the
* maximum value is 14d.
*
* Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $wait = null;
+ protected $wait = null;
/**
* Optional. The pattern of how wait time will be increased. Default is
* linear. Backoff mode will be ignored if `wait` is 0.
*
* Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $backoff_mode = 0;
+ protected $backoff_mode = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/RetryAttempt.php b/Deploy/src/V1/RetryAttempt.php
index f82a36fb3a83..469c65d247e7 100644
--- a/Deploy/src/V1/RetryAttempt.php
+++ b/Deploy/src/V1/RetryAttempt.php
@@ -20,25 +20,25 @@ class RetryAttempt extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int64 attempt = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $attempt = 0;
+ protected $attempt = 0;
/**
* Output only. How long the operation will be paused.
*
* Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $wait = null;
+ protected $wait = null;
/**
* Output only. Valid state of this retry action.
*
* Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. Description of the state of the Retry.
*
* Generated from protobuf field string state_desc = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state_desc = '';
+ protected $state_desc = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/RetryJobRequest.php b/Deploy/src/V1/RetryJobRequest.php
index 584ac5d52b23..eb2ecc465174 100644
--- a/Deploy/src/V1/RetryJobRequest.php
+++ b/Deploy/src/V1/RetryJobRequest.php
@@ -21,19 +21,19 @@ class RetryJobRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* Required. The phase ID the Job to retry belongs to.
*
* Generated from protobuf field string phase_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $phase_id = '';
+ protected $phase_id = '';
/**
* Required. The job ID for the Job to retry.
*
* Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $job_id = '';
+ protected $job_id = '';
/**
* @param string $rollout Required. Name of the Rollout. Format is
diff --git a/Deploy/src/V1/RetryPhase.php b/Deploy/src/V1/RetryPhase.php
index 581451ee680a..0eb3f79d6b1d 100644
--- a/Deploy/src/V1/RetryPhase.php
+++ b/Deploy/src/V1/RetryPhase.php
@@ -21,26 +21,26 @@ class RetryPhase extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field int64 total_attempts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $total_attempts = 0;
+ protected $total_attempts = 0;
/**
* Output only. The pattern of how the wait time of the retry attempt is
* calculated.
*
* Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $backoff_mode = 0;
+ protected $backoff_mode = 0;
/**
* Output only. The phase ID of the phase that includes the job being retried.
*
* Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $phase_id = '';
+ protected $phase_id = '';
/**
* Output only. The job ID for the Job to retry.
*
* Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $job_id = '';
+ protected $job_id = '';
/**
* Output only. Detail of a retry action.
*
diff --git a/Deploy/src/V1/Rollback.php b/Deploy/src/V1/Rollback.php
index 91deb3d77b35..62a577b8775e 100644
--- a/Deploy/src/V1/Rollback.php
+++ b/Deploy/src/V1/Rollback.php
@@ -21,7 +21,7 @@ class Rollback extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $destination_phase = '';
+ protected $destination_phase = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/RollbackAttempt.php b/Deploy/src/V1/RollbackAttempt.php
index ad08b378c1be..6cf2b0dae8d7 100644
--- a/Deploy/src/V1/RollbackAttempt.php
+++ b/Deploy/src/V1/RollbackAttempt.php
@@ -20,25 +20,25 @@ class RollbackAttempt extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $destination_phase = '';
+ protected $destination_phase = '';
/**
* Output only. ID of the rollback `Rollout` to create.
*
* Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollout_id = '';
+ protected $rollout_id = '';
/**
* Output only. Valid state of this rollback action.
*
* Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. Description of the state of the Rollback.
*
* Generated from protobuf field string state_desc = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state_desc = '';
+ protected $state_desc = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/RollbackTargetConfig.php b/Deploy/src/V1/RollbackTargetConfig.php
index 2d2e4d089290..0993a0b5efbe 100644
--- a/Deploy/src/V1/RollbackTargetConfig.php
+++ b/Deploy/src/V1/RollbackTargetConfig.php
@@ -20,14 +20,14 @@ class RollbackTargetConfig extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $rollout = null;
+ protected $rollout = null;
/**
* Optional. The starting phase ID for the `Rollout`. If unspecified, the
* `Rollout` will start in the stable phase.
*
* Generated from protobuf field string starting_phase_id = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $starting_phase_id = '';
+ protected $starting_phase_id = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/RollbackTargetRequest.php b/Deploy/src/V1/RollbackTargetRequest.php
index 5e46e61fd554..2d634cbd0e5e 100644
--- a/Deploy/src/V1/RollbackTargetRequest.php
+++ b/Deploy/src/V1/RollbackTargetRequest.php
@@ -22,19 +22,19 @@ class RollbackTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* Required. ID of the `Target` that is being rolled back.
*
* Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Required. ID of the rollback `Rollout` to create.
*
* Generated from protobuf field string rollout_id = 3 [(.google.api.field_behavior) = REQUIRED];
*/
- private $rollout_id = '';
+ protected $rollout_id = '';
/**
* Optional. ID of the `Release` to roll back to. If this isn't specified, the
* previous successful `Rollout` to the specified target will be used to
@@ -42,27 +42,27 @@ class RollbackTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string release_id = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $release_id = '';
+ protected $release_id = '';
/**
* Optional. If provided, this must be the latest `Rollout` that is on the
* `Target`.
*
* Generated from protobuf field string rollout_to_roll_back = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $rollout_to_roll_back = '';
+ protected $rollout_to_roll_back = '';
/**
* Optional. Configs for the rollback `Rollout`.
*
* Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 6 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $rollback_config = null;
+ protected $rollback_config = null;
/**
* Optional. If set to true, the request is validated and the user is provided
* with a `RollbackTargetResponse`.
*
* Generated from protobuf field bool validate_only = 7 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` should be
diff --git a/Deploy/src/V1/RollbackTargetResponse.php b/Deploy/src/V1/RollbackTargetResponse.php
index 4096fbe0bad5..0c2baf18351b 100644
--- a/Deploy/src/V1/RollbackTargetResponse.php
+++ b/Deploy/src/V1/RollbackTargetResponse.php
@@ -20,7 +20,7 @@ class RollbackTargetResponse extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 1;
*/
- private $rollback_config = null;
+ protected $rollback_config = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/Rollout.php b/Deploy/src/V1/Rollout.php
index 2198b481909c..4a50ee1c678b 100644
--- a/Deploy/src/V1/Rollout.php
+++ b/Deploy/src/V1/Rollout.php
@@ -23,20 +23,20 @@ class Rollout extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Unique identifier of the `Rollout`.
*
* Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Description of the `Rollout` for user purposes. Max length is 255
* characters.
*
* Generated from protobuf field string description = 3;
*/
- private $description = '';
+ protected $description = '';
/**
* User annotations. These attributes can only be set and used by the
* user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations
@@ -64,56 +64,56 @@ class Rollout extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Time at which the `Rollout` was approved.
*
* Generated from protobuf field .google.protobuf.Timestamp approve_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $approve_time = null;
+ protected $approve_time = null;
/**
* Output only. Time at which the `Rollout` was enqueued.
*
* Generated from protobuf field .google.protobuf.Timestamp enqueue_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $enqueue_time = null;
+ protected $enqueue_time = null;
/**
* Output only. Time at which the `Rollout` started deploying.
*
* Generated from protobuf field .google.protobuf.Timestamp deploy_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $deploy_start_time = null;
+ protected $deploy_start_time = null;
/**
* Output only. Time at which the `Rollout` finished deploying.
*
* Generated from protobuf field .google.protobuf.Timestamp deploy_end_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $deploy_end_time = null;
+ protected $deploy_end_time = null;
/**
* Required. The ID of Target to which this `Rollout` is deploying.
*
* Generated from protobuf field string target_id = 18 [(.google.api.field_behavior) = REQUIRED];
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Output only. Approval state of the `Rollout`.
*
* Generated from protobuf field .google.cloud.deploy.v1.Rollout.ApprovalState approval_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $approval_state = 0;
+ protected $approval_state = 0;
/**
* Output only. Current state of the `Rollout`.
*
* Generated from protobuf field .google.cloud.deploy.v1.Rollout.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $state = 0;
+ protected $state = 0;
/**
* Output only. Additional information about the rollout failure, if
* available.
*
* Generated from protobuf field string failure_reason = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_reason = '';
+ protected $failure_reason = '';
/**
* Output only. The resource name of the Cloud Build `Build` object that is
* used to deploy the Rollout. Format is
@@ -121,7 +121,7 @@ class Rollout extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string deploying_build = 17 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $deploying_build = '';
+ protected $deploying_build = '';
/**
* This checksum is computed by the server based on the value of other
* fields, and may be sent on update and delete requests to ensure the
@@ -129,14 +129,14 @@ class Rollout extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 16;
*/
- private $etag = '';
+ protected $etag = '';
/**
* Output only. The reason this rollout failed. This will always be
* unspecified while the rollout is in progress.
*
* Generated from protobuf field .google.cloud.deploy.v1.Rollout.FailureCause deploy_failure_cause = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $deploy_failure_cause = 0;
+ protected $deploy_failure_cause = 0;
/**
* Output only. The phases that represent the workflows of this `Rollout`.
*
@@ -148,21 +148,21 @@ class Rollout extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Metadata metadata = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $metadata = null;
+ protected $metadata = null;
/**
* Output only. Name of the `ControllerRollout`. Format is
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
*
* Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $controller_rollout = '';
+ protected $controller_rollout = '';
/**
* Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
* Empty if this `Rollout` wasn't created as a rollback.
*
* Generated from protobuf field string rollback_of_rollout = 26 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $rollback_of_rollout = '';
+ protected $rollback_of_rollout = '';
/**
* Output only. Names of `Rollouts` that rolled back this `Rollout`.
*
diff --git a/Deploy/src/V1/RolloutNotificationEvent.php b/Deploy/src/V1/RolloutNotificationEvent.php
index 8fc158fbc53c..98651e6feff8 100644
--- a/Deploy/src/V1/RolloutNotificationEvent.php
+++ b/Deploy/src/V1/RolloutNotificationEvent.php
@@ -22,49 +22,49 @@ class RolloutNotificationEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* Unique identifier of the `DeliveryPipeline`.
*
* Generated from protobuf field string pipeline_uid = 2;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* Unique identifier of the `Release`.
*
* Generated from protobuf field string release_uid = 3;
*/
- private $release_uid = '';
+ protected $release_uid = '';
/**
* The name of the `Release`.
*
* Generated from protobuf field string release = 7;
*/
- private $release = '';
+ protected $release = '';
/**
* Unique identifier of the `Rollout`.
*
* Generated from protobuf field string rollout_uid = 8;
*/
- private $rollout_uid = '';
+ protected $rollout_uid = '';
/**
* The name of the `Rollout`.
*
* Generated from protobuf field string rollout = 4;
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* ID of the `Target` that the rollout is deployed to.
*
* Generated from protobuf field string target_id = 6;
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 5;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/RolloutUpdateEvent.php b/Deploy/src/V1/RolloutUpdateEvent.php
index a54242de7979..6595c48a0d0f 100644
--- a/Deploy/src/V1/RolloutUpdateEvent.php
+++ b/Deploy/src/V1/RolloutUpdateEvent.php
@@ -21,25 +21,25 @@ class RolloutUpdateEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 6;
*/
- private $message = '';
+ protected $message = '';
/**
* Unique identifier of the pipeline.
*
* Generated from protobuf field string pipeline_uid = 1;
*/
- private $pipeline_uid = '';
+ protected $pipeline_uid = '';
/**
* Unique identifier of the release.
*
* Generated from protobuf field string release_uid = 2;
*/
- private $release_uid = '';
+ protected $release_uid = '';
/**
* The name of the `Release`.
*
* Generated from protobuf field string release = 8;
*/
- private $release = '';
+ protected $release = '';
/**
* The name of the rollout.
* rollout_uid is not in this log message because we write some of these log
@@ -47,25 +47,25 @@ class RolloutUpdateEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string rollout = 3;
*/
- private $rollout = '';
+ protected $rollout = '';
/**
* ID of the target.
*
* Generated from protobuf field string target_id = 4;
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Type of this notification, e.g. for a rollout update event.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 7;
*/
- private $type = 0;
+ protected $type = 0;
/**
* The type of the rollout update.
*
* Generated from protobuf field .google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType rollout_update_type = 5;
*/
- private $rollout_update_type = 0;
+ protected $rollout_update_type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php b/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php
index 0f4734229729..6e127f43b50e 100644
--- a/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php
+++ b/Deploy/src/V1/SkaffoldModules/SkaffoldGCBRepoSource.php
@@ -22,20 +22,20 @@ class SkaffoldGCBRepoSource extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $repository = '';
+ protected $repository = '';
/**
* Optional. Relative path from the repository root to the Skaffold Config
* file.
*
* Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $path = '';
+ protected $path = '';
/**
* Optional. Branch or tag to use when cloning the repository.
*
* Generated from protobuf field string ref = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $ref = '';
+ protected $ref = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php b/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php
index ba9ad170c5d2..d1698a009cd5 100644
--- a/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php
+++ b/Deploy/src/V1/SkaffoldModules/SkaffoldGCSSource.php
@@ -22,13 +22,13 @@ class SkaffoldGCSSource extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string source = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $source = '';
+ protected $source = '';
/**
* Optional. Relative path from the source to the Skaffold file.
*
* Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $path = '';
+ protected $path = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php b/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php
index 53ae74f44aca..7d4206aada60 100644
--- a/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php
+++ b/Deploy/src/V1/SkaffoldModules/SkaffoldGitSource.php
@@ -20,19 +20,19 @@ class SkaffoldGitSource extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string repo = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $repo = '';
+ protected $repo = '';
/**
* Optional. Relative path from the repository root to the Skaffold file.
*
* Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $path = '';
+ protected $path = '';
/**
* Optional. Git branch or tag to use when cloning the repository.
*
* Generated from protobuf field string ref = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $ref = '';
+ protected $ref = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/SkaffoldVersion.php b/Deploy/src/V1/SkaffoldVersion.php
index ed1fc72debb4..025ceb464b68 100644
--- a/Deploy/src/V1/SkaffoldVersion.php
+++ b/Deploy/src/V1/SkaffoldVersion.php
@@ -20,25 +20,25 @@ class SkaffoldVersion extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string version = 1;
*/
- private $version = '';
+ protected $version = '';
/**
* The time at which this version of Skaffold will enter maintenance mode.
*
* Generated from protobuf field .google.protobuf.Timestamp maintenance_mode_time = 3;
*/
- private $maintenance_mode_time = null;
+ protected $maintenance_mode_time = null;
/**
* The time at which this version of Skaffold will no longer be supported.
*
* Generated from protobuf field .google.protobuf.Timestamp support_expiration_time = 4;
*/
- private $support_expiration_time = null;
+ protected $support_expiration_time = null;
/**
* Date when this version is expected to no longer be supported.
*
* Generated from protobuf field .google.type.Date support_end_date = 2;
*/
- private $support_end_date = null;
+ protected $support_end_date = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/Stage.php b/Deploy/src/V1/Stage.php
index be722b86cb7b..ffd1b986043b 100644
--- a/Deploy/src/V1/Stage.php
+++ b/Deploy/src/V1/Stage.php
@@ -25,7 +25,7 @@ class Stage extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string target_id = 1;
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Skaffold profiles to use when rendering the manifest for this stage's
* `Target`.
@@ -38,7 +38,7 @@ class Stage extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.cloud.deploy.v1.Strategy strategy = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $strategy = null;
+ protected $strategy = null;
/**
* Optional. The deploy parameters to use for the target in this stage.
*
diff --git a/Deploy/src/V1/Standard.php b/Deploy/src/V1/Standard.php
index f031263eaf22..5dfce8ecc950 100644
--- a/Deploy/src/V1/Standard.php
+++ b/Deploy/src/V1/Standard.php
@@ -20,21 +20,21 @@ class Standard extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool verify = 1;
*/
- private $verify = false;
+ protected $verify = false;
/**
* Optional. Configuration for the predeploy job. If this is not configured,
* predeploy job will not be present.
*
* Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 2 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $predeploy = null;
+ protected $predeploy = null;
/**
* Optional. Configuration for the postdeploy job. If this is not configured,
* postdeploy job will not be present.
*
* Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $postdeploy = null;
+ protected $postdeploy = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/Target.php b/Deploy/src/V1/Target.php
index 50b30289ef67..8e17d8f3b811 100644
--- a/Deploy/src/V1/Target.php
+++ b/Deploy/src/V1/Target.php
@@ -24,25 +24,25 @@ class Target extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $name = '';
+ protected $name = '';
/**
* Output only. Resource id of the `Target`.
*
* Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $target_id = '';
+ protected $target_id = '';
/**
* Output only. Unique identifier of the `Target`.
*
* Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $uid = '';
+ protected $uid = '';
/**
* Optional. Description of the `Target`. Max length is 255 characters.
*
* Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $description = '';
+ protected $description = '';
/**
* Optional. User annotations. These attributes can only be set and used by
* the user, and not by Cloud Deploy. See
@@ -71,19 +71,19 @@ class Target extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool require_approval = 13 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $require_approval = false;
+ protected $require_approval = false;
/**
* Output only. Time at which the `Target` was created.
*
* Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $create_time = null;
+ protected $create_time = null;
/**
* Output only. Most recent time at which the `Target` was updated.
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Optional. This checksum is computed by the server based on the value of
* other fields, and may be sent on update and delete requests to ensure the
@@ -91,7 +91,7 @@ class Target extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $etag = '';
+ protected $etag = '';
/**
* Configurations for all execution that relates to this `Target`.
* Each `ExecutionEnvironmentUsage` value may only be used in a single
diff --git a/Deploy/src/V1/TargetArtifact.php b/Deploy/src/V1/TargetArtifact.php
index 8170412afdcc..dcca9ff5bfa5 100644
--- a/Deploy/src/V1/TargetArtifact.php
+++ b/Deploy/src/V1/TargetArtifact.php
@@ -21,13 +21,13 @@ class TargetArtifact extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string skaffold_config_path = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $skaffold_config_path = '';
+ protected $skaffold_config_path = '';
/**
* Output only. File path of the rendered manifest relative to the URI.
*
* Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $manifest_path = '';
+ protected $manifest_path = '';
/**
* Output only. Map from the phase ID to the phase artifacts for the `Target`.
*
diff --git a/Deploy/src/V1/TargetArtifact/PhaseArtifact.php b/Deploy/src/V1/TargetArtifact/PhaseArtifact.php
index 7d9c36f11774..b5b18b9643ff 100644
--- a/Deploy/src/V1/TargetArtifact/PhaseArtifact.php
+++ b/Deploy/src/V1/TargetArtifact/PhaseArtifact.php
@@ -21,20 +21,20 @@ class PhaseArtifact extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string skaffold_config_path = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $skaffold_config_path = '';
+ protected $skaffold_config_path = '';
/**
* Output only. File path of the rendered manifest relative to the URI.
*
* Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $manifest_path = '';
+ protected $manifest_path = '';
/**
* Output only. File path of the directory of rendered job manifests
* relative to the URI. This is only set if it is applicable.
*
* Generated from protobuf field string job_manifests_path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $job_manifests_path = '';
+ protected $job_manifests_path = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/TargetAttribute.php b/Deploy/src/V1/TargetAttribute.php
index aa202d0f74eb..2ad745bdf87b 100644
--- a/Deploy/src/V1/TargetAttribute.php
+++ b/Deploy/src/V1/TargetAttribute.php
@@ -24,7 +24,7 @@ class TargetAttribute extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string id = 1;
*/
- private $id = '';
+ protected $id = '';
/**
* Target labels.
*
diff --git a/Deploy/src/V1/TargetNotificationEvent.php b/Deploy/src/V1/TargetNotificationEvent.php
index 93cf6eeecc79..60f2044019f6 100644
--- a/Deploy/src/V1/TargetNotificationEvent.php
+++ b/Deploy/src/V1/TargetNotificationEvent.php
@@ -22,19 +22,19 @@ class TargetNotificationEvent extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string message = 1;
*/
- private $message = '';
+ protected $message = '';
/**
* The name of the `Target`.
*
* Generated from protobuf field string target = 2;
*/
- private $target = '';
+ protected $target = '';
/**
* Type of this notification, e.g. for a Pub/Sub failure.
*
* Generated from protobuf field .google.cloud.deploy.v1.Type type = 3;
*/
- private $type = 0;
+ protected $type = 0;
/**
* Constructor.
diff --git a/Deploy/src/V1/TargetsPresentCondition.php b/Deploy/src/V1/TargetsPresentCondition.php
index 7cf53d127686..7dba90cabb9d 100644
--- a/Deploy/src/V1/TargetsPresentCondition.php
+++ b/Deploy/src/V1/TargetsPresentCondition.php
@@ -21,7 +21,7 @@ class TargetsPresentCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool status = 1;
*/
- private $status = false;
+ protected $status = false;
/**
* The list of Target names that do not exist. For example,
* `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
@@ -34,7 +34,7 @@ class TargetsPresentCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.Timestamp update_time = 4;
*/
- private $update_time = null;
+ protected $update_time = null;
/**
* Constructor.
diff --git a/Deploy/src/V1/TargetsTypeCondition.php b/Deploy/src/V1/TargetsTypeCondition.php
index 90e650b8d96e..34705dbf6df7 100644
--- a/Deploy/src/V1/TargetsTypeCondition.php
+++ b/Deploy/src/V1/TargetsTypeCondition.php
@@ -23,13 +23,13 @@ class TargetsTypeCondition extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field bool status = 1;
*/
- private $status = false;
+ protected $status = false;
/**
* Human readable error message.
*
* Generated from protobuf field string error_details = 2;
*/
- private $error_details = '';
+ protected $error_details = '';
/**
* Constructor.
diff --git a/Deploy/src/V1/TerminateJobRunRequest.php b/Deploy/src/V1/TerminateJobRunRequest.php
index 0f065707dcfe..4264a7361286 100644
--- a/Deploy/src/V1/TerminateJobRunRequest.php
+++ b/Deploy/src/V1/TerminateJobRunRequest.php
@@ -21,7 +21,7 @@ class TerminateJobRunRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
- private $name = '';
+ protected $name = '';
/**
* @param string $name Required. Name of the `JobRun`. Format must be
diff --git a/Deploy/src/V1/UpdateAutomationRequest.php b/Deploy/src/V1/UpdateAutomationRequest.php
index 375d3d5ce93e..0e0955a6a129 100644
--- a/Deploy/src/V1/UpdateAutomationRequest.php
+++ b/Deploy/src/V1/UpdateAutomationRequest.php
@@ -24,13 +24,13 @@ class UpdateAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $update_mask = null;
+ protected $update_mask = null;
/**
* Required. The `Automation` to update.
*
* Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $automation = null;
+ protected $automation = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -46,21 +46,21 @@ class UpdateAutomationRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, updating a `Automation` that does not exist will
* result in the creation of a new `Automation`.
*
* Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param \Google\Cloud\Deploy\V1\Automation $automation Required. The `Automation` to update.
diff --git a/Deploy/src/V1/UpdateCustomTargetTypeRequest.php b/Deploy/src/V1/UpdateCustomTargetTypeRequest.php
index 0dafd5aee52d..f6bcbf1d6395 100644
--- a/Deploy/src/V1/UpdateCustomTargetTypeRequest.php
+++ b/Deploy/src/V1/UpdateCustomTargetTypeRequest.php
@@ -24,13 +24,13 @@ class UpdateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $update_mask = null;
+ protected $update_mask = null;
/**
* Required. The `CustomTargetType` to update.
*
* Generated from protobuf field .google.cloud.deploy.v1.CustomTargetType custom_target_type = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $custom_target_type = null;
+ protected $custom_target_type = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -46,21 +46,21 @@ class UpdateCustomTargetTypeRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, updating a `CustomTargetType` that does not exist
* will result in the creation of a new `CustomTargetType`.
*
* Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param \Google\Cloud\Deploy\V1\CustomTargetType $customTargetType Required. The `CustomTargetType` to update.
diff --git a/Deploy/src/V1/UpdateDeliveryPipelineRequest.php b/Deploy/src/V1/UpdateDeliveryPipelineRequest.php
index 1d69916211f5..dea1172e93e5 100644
--- a/Deploy/src/V1/UpdateDeliveryPipelineRequest.php
+++ b/Deploy/src/V1/UpdateDeliveryPipelineRequest.php
@@ -24,13 +24,13 @@ class UpdateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $update_mask = null;
+ protected $update_mask = null;
/**
* Required. The `DeliveryPipeline` to update.
*
* Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $delivery_pipeline = null;
+ protected $delivery_pipeline = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -46,21 +46,21 @@ class UpdateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, updating a `DeliveryPipeline` that does not exist
* will result in the creation of a new `DeliveryPipeline`.
*
* Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param \Google\Cloud\Deploy\V1\DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to update.
diff --git a/Deploy/src/V1/UpdateTargetRequest.php b/Deploy/src/V1/UpdateTargetRequest.php
index d50f7101103c..7823d7339fdd 100644
--- a/Deploy/src/V1/UpdateTargetRequest.php
+++ b/Deploy/src/V1/UpdateTargetRequest.php
@@ -24,13 +24,13 @@ class UpdateTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];
*/
- private $update_mask = null;
+ protected $update_mask = null;
/**
* Required. The `Target` to update.
*
* Generated from protobuf field .google.cloud.deploy.v1.Target target = 2 [(.google.api.field_behavior) = REQUIRED];
*/
- private $target = null;
+ protected $target = null;
/**
* Optional. A request ID to identify requests. Specify a unique request ID
* so that if you must retry your request, the server knows to ignore the
@@ -46,21 +46,21 @@ class UpdateTargetRequest extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $request_id = '';
+ protected $request_id = '';
/**
* Optional. If set to true, updating a `Target` that does not exist will
* result in the creation of a new `Target`.
*
* Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $allow_missing = false;
+ protected $allow_missing = false;
/**
* Optional. If set to true, the request is validated and the user is provided
* with an expected result, but no actual change is made.
*
* Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL];
*/
- private $validate_only = false;
+ protected $validate_only = false;
/**
* @param \Google\Cloud\Deploy\V1\Target $target Required. The `Target` to update.
diff --git a/Deploy/src/V1/VerifyJobRun.php b/Deploy/src/V1/VerifyJobRun.php
index a3442a60bc4d..71c2c05ff0a9 100644
--- a/Deploy/src/V1/VerifyJobRun.php
+++ b/Deploy/src/V1/VerifyJobRun.php
@@ -22,34 +22,34 @@ class VerifyJobRun extends \Google\Protobuf\Internal\Message
*
* Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {
*/
- private $build = '';
+ protected $build = '';
/**
* Output only. URI of a directory containing the verify artifacts. This
* contains the Skaffold event log.
*
* Generated from protobuf field string artifact_uri = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $artifact_uri = '';
+ protected $artifact_uri = '';
/**
* Output only. File path of the Skaffold event log relative to the artifact
* URI.
*
* Generated from protobuf field string event_log_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $event_log_path = '';
+ protected $event_log_path = '';
/**
* Output only. The reason the verify failed. This will always be unspecified
* while the verify is in progress or if it succeeded.
*
* Generated from protobuf field .google.cloud.deploy.v1.VerifyJobRun.FailureCause failure_cause = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_cause = 0;
+ protected $failure_cause = 0;
/**
* Output only. Additional information about the verify failure, if available.
*
* Generated from protobuf field string failure_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*/
- private $failure_message = '';
+ protected $failure_message = '';
/**
* Constructor.
diff --git a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php
index 045098db6bae..f0572c7f722d 100644
--- a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php
+++ b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php
@@ -1,6 +1,6 @@
getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock();
+ return $this->getMockBuilder(CredentialsWrapper::class)
+ ->disableOriginalConstructor()
+ ->getMock();
}
/** @return CloudDeployClient */
@@ -153,8 +155,7 @@ public function abandonReleaseTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new AbandonReleaseRequest())
- ->setName($formattedName);
+ $request = (new AbandonReleaseRequest())->setName($formattedName);
$response = $gapicClient->abandonRelease($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -178,17 +179,19 @@ public function abandonReleaseExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new AbandonReleaseRequest())
- ->setName($formattedName);
+ $request = (new AbandonReleaseRequest())->setName($formattedName);
try {
$gapicClient->abandonRelease($request);
// If the $gapicClient method call did not throw, fail the test
@@ -214,11 +217,15 @@ public function advanceRolloutTest()
$expectedResponse = new AdvanceRolloutResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$phaseId = 'phaseId-1676299681';
- $request = (new AdvanceRolloutRequest())
- ->setName($formattedName)
- ->setPhaseId($phaseId);
+ $request = (new AdvanceRolloutRequest())->setName($formattedName)->setPhaseId($phaseId);
$response = $gapicClient->advanceRollout($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -244,19 +251,26 @@ public function advanceRolloutExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$phaseId = 'phaseId-1676299681';
- $request = (new AdvanceRolloutRequest())
- ->setName($formattedName)
- ->setPhaseId($phaseId);
+ $request = (new AdvanceRolloutRequest())->setName($formattedName)->setPhaseId($phaseId);
try {
$gapicClient->advanceRollout($request);
// If the $gapicClient method call did not throw, fail the test
@@ -282,11 +296,15 @@ public function approveRolloutTest()
$expectedResponse = new ApproveRolloutResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$approved = false;
- $request = (new ApproveRolloutRequest())
- ->setName($formattedName)
- ->setApproved($approved);
+ $request = (new ApproveRolloutRequest())->setName($formattedName)->setApproved($approved);
$response = $gapicClient->approveRollout($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -312,19 +330,26 @@ public function approveRolloutExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$approved = false;
- $request = (new ApproveRolloutRequest())
- ->setName($formattedName)
- ->setApproved($approved);
+ $request = (new ApproveRolloutRequest())->setName($formattedName)->setApproved($approved);
try {
$gapicClient->approveRollout($request);
// If the $gapicClient method call did not throw, fail the test
@@ -350,9 +375,13 @@ public function cancelAutomationRunTest()
$expectedResponse = new CancelAutomationRunResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- $request = (new CancelAutomationRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->automationRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[AUTOMATION_RUN]'
+ );
+ $request = (new CancelAutomationRunRequest())->setName($formattedName);
$response = $gapicClient->cancelAutomationRun($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -376,17 +405,24 @@ public function cancelAutomationRunExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- $request = (new CancelAutomationRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->automationRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[AUTOMATION_RUN]'
+ );
+ $request = (new CancelAutomationRunRequest())->setName($formattedName);
try {
$gapicClient->cancelAutomationRun($request);
// If the $gapicClient method call did not throw, fail the test
@@ -412,9 +448,14 @@ public function cancelRolloutTest()
$expectedResponse = new CancelRolloutResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $request = (new CancelRolloutRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
+ $request = (new CancelRolloutRequest())->setName($formattedName);
$response = $gapicClient->cancelRollout($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -438,17 +479,25 @@ public function cancelRolloutExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $request = (new CancelRolloutRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
+ $request = (new CancelRolloutRequest())->setName($formattedName);
try {
$gapicClient->cancelRollout($request);
// If the $gapicClient method call did not throw, fail the test
@@ -576,12 +625,15 @@ public function createAutomationExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
@@ -725,12 +777,15 @@ public function createCustomTargetTypeExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
@@ -868,12 +923,15 @@ public function createDeliveryPipelineExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
@@ -1017,12 +1075,15 @@ public function createReleaseExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
@@ -1170,12 +1231,15 @@ public function createRolloutExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
@@ -1317,12 +1381,15 @@ public function createTargetExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
@@ -1385,8 +1452,7 @@ public function deleteAutomationTest()
$operationsTransport->addResponse($completeOperation);
// Mock request
$formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $request = (new DeleteAutomationRequest())
- ->setName($formattedName);
+ $request = (new DeleteAutomationRequest())->setName($formattedName);
$response = $gapicClient->deleteAutomation($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1442,17 +1508,19 @@ public function deleteAutomationExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $request = (new DeleteAutomationRequest())
- ->setName($formattedName);
+ $request = (new DeleteAutomationRequest())->setName($formattedName);
$response = $gapicClient->deleteAutomation($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1506,8 +1574,7 @@ public function deleteCustomTargetTypeTest()
$operationsTransport->addResponse($completeOperation);
// Mock request
$formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $request = (new DeleteCustomTargetTypeRequest())
- ->setName($formattedName);
+ $request = (new DeleteCustomTargetTypeRequest())->setName($formattedName);
$response = $gapicClient->deleteCustomTargetType($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1563,17 +1630,19 @@ public function deleteCustomTargetTypeExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $request = (new DeleteCustomTargetTypeRequest())
- ->setName($formattedName);
+ $request = (new DeleteCustomTargetTypeRequest())->setName($formattedName);
$response = $gapicClient->deleteCustomTargetType($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1627,8 +1696,7 @@ public function deleteDeliveryPipelineTest()
$operationsTransport->addResponse($completeOperation);
// Mock request
$formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new DeleteDeliveryPipelineRequest())
- ->setName($formattedName);
+ $request = (new DeleteDeliveryPipelineRequest())->setName($formattedName);
$response = $gapicClient->deleteDeliveryPipeline($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1684,17 +1752,19 @@ public function deleteDeliveryPipelineExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new DeleteDeliveryPipelineRequest())
- ->setName($formattedName);
+ $request = (new DeleteDeliveryPipelineRequest())->setName($formattedName);
$response = $gapicClient->deleteDeliveryPipeline($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1748,8 +1818,7 @@ public function deleteTargetTest()
$operationsTransport->addResponse($completeOperation);
// Mock request
$formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $request = (new DeleteTargetRequest())
- ->setName($formattedName);
+ $request = (new DeleteTargetRequest())->setName($formattedName);
$response = $gapicClient->deleteTarget($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1805,17 +1874,19 @@ public function deleteTargetExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $request = (new DeleteTargetRequest())
- ->setName($formattedName);
+ $request = (new DeleteTargetRequest())->setName($formattedName);
$response = $gapicClient->deleteTarget($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -1863,8 +1934,7 @@ public function getAutomationTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $request = (new GetAutomationRequest())
- ->setName($formattedName);
+ $request = (new GetAutomationRequest())->setName($formattedName);
$response = $gapicClient->getAutomation($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -1888,17 +1958,19 @@ public function getAutomationExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $request = (new GetAutomationRequest())
- ->setName($formattedName);
+ $request = (new GetAutomationRequest())->setName($formattedName);
try {
$gapicClient->getAutomation($request);
// If the $gapicClient method call did not throw, fail the test
@@ -1938,9 +2010,13 @@ public function getAutomationRunTest()
$expectedResponse->setAutomationId($automationId);
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- $request = (new GetAutomationRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->automationRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[AUTOMATION_RUN]'
+ );
+ $request = (new GetAutomationRunRequest())->setName($formattedName);
$response = $gapicClient->getAutomationRun($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -1964,17 +2040,24 @@ public function getAutomationRunExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- $request = (new GetAutomationRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->automationRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[AUTOMATION_RUN]'
+ );
+ $request = (new GetAutomationRunRequest())->setName($formattedName);
try {
$gapicClient->getAutomationRun($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2005,8 +2088,7 @@ public function getConfigTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]');
- $request = (new GetConfigRequest())
- ->setName($formattedName);
+ $request = (new GetConfigRequest())->setName($formattedName);
$response = $gapicClient->getConfig($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2030,17 +2112,19 @@ public function getConfigExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]');
- $request = (new GetConfigRequest())
- ->setName($formattedName);
+ $request = (new GetConfigRequest())->setName($formattedName);
try {
$gapicClient->getConfig($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2077,8 +2161,7 @@ public function getCustomTargetTypeTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $request = (new GetCustomTargetTypeRequest())
- ->setName($formattedName);
+ $request = (new GetCustomTargetTypeRequest())->setName($formattedName);
$response = $gapicClient->getCustomTargetType($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2102,17 +2185,19 @@ public function getCustomTargetTypeExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $request = (new GetCustomTargetTypeRequest())
- ->setName($formattedName);
+ $request = (new GetCustomTargetTypeRequest())->setName($formattedName);
try {
$gapicClient->getCustomTargetType($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2149,8 +2234,7 @@ public function getDeliveryPipelineTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new GetDeliveryPipelineRequest())
- ->setName($formattedName);
+ $request = (new GetDeliveryPipelineRequest())->setName($formattedName);
$response = $gapicClient->getDeliveryPipeline($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2174,17 +2258,19 @@ public function getDeliveryPipelineExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new GetDeliveryPipelineRequest())
- ->setName($formattedName);
+ $request = (new GetDeliveryPipelineRequest())->setName($formattedName);
try {
$gapicClient->getDeliveryPipeline($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2220,9 +2306,15 @@ public function getJobRunTest()
$expectedResponse->setEtag($etag);
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- $request = (new GetJobRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->jobRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]',
+ '[JOB_RUN]'
+ );
+ $request = (new GetJobRunRequest())->setName($formattedName);
$response = $gapicClient->getJobRun($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2246,17 +2338,26 @@ public function getJobRunExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- $request = (new GetJobRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->jobRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]',
+ '[JOB_RUN]'
+ );
+ $request = (new GetJobRunRequest())->setName($formattedName);
try {
$gapicClient->getJobRun($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2299,8 +2400,7 @@ public function getReleaseTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new GetReleaseRequest())
- ->setName($formattedName);
+ $request = (new GetReleaseRequest())->setName($formattedName);
$response = $gapicClient->getRelease($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2324,17 +2424,19 @@ public function getReleaseExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new GetReleaseRequest())
- ->setName($formattedName);
+ $request = (new GetReleaseRequest())->setName($formattedName);
try {
$gapicClient->getRelease($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2378,9 +2480,14 @@ public function getRolloutTest()
$expectedResponse->setRollbackOfRollout($rollbackOfRollout);
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $request = (new GetRolloutRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
+ $request = (new GetRolloutRequest())->setName($formattedName);
$response = $gapicClient->getRollout($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2404,17 +2511,25 @@ public function getRolloutExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $request = (new GetRolloutRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
+ $request = (new GetRolloutRequest())->setName($formattedName);
try {
$gapicClient->getRollout($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2453,8 +2568,7 @@ public function getTargetTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $request = (new GetTargetRequest())
- ->setName($formattedName);
+ $request = (new GetTargetRequest())->setName($formattedName);
$response = $gapicClient->getTarget($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -2478,17 +2592,19 @@ public function getTargetExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $request = (new GetTargetRequest())
- ->setName($formattedName);
+ $request = (new GetTargetRequest())->setName($formattedName);
try {
$gapicClient->getTarget($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2514,7 +2630,13 @@ public function ignoreJobTest()
$expectedResponse = new IgnoreJobResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedRollout = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$phaseId = 'phaseId-1676299681';
$jobId = 'jobId-1154752291';
$request = (new IgnoreJobRequest())
@@ -2548,15 +2670,24 @@ public function ignoreJobExceptionTest()
$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);
// Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedRollout = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$phaseId = 'phaseId-1676299681';
$jobId = 'jobId-1154752291';
$request = (new IgnoreJobRequest())
@@ -2587,17 +2718,14 @@ public function listAutomationRunsTest()
// Mock response
$nextPageToken = '';
$automationRunsElement = new AutomationRun();
- $automationRuns = [
- $automationRunsElement,
- ];
+ $automationRuns = [$automationRunsElement];
$expectedResponse = new ListAutomationRunsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setAutomationRuns($automationRuns);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new ListAutomationRunsRequest())
- ->setParent($formattedParent);
+ $request = (new ListAutomationRunsRequest())->setParent($formattedParent);
$response = $gapicClient->listAutomationRuns($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -2624,17 +2752,19 @@ public function listAutomationRunsExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new ListAutomationRunsRequest())
- ->setParent($formattedParent);
+ $request = (new ListAutomationRunsRequest())->setParent($formattedParent);
try {
$gapicClient->listAutomationRuns($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2659,17 +2789,14 @@ public function listAutomationsTest()
// Mock response
$nextPageToken = '';
$automationsElement = new Automation();
- $automations = [
- $automationsElement,
- ];
+ $automations = [$automationsElement];
$expectedResponse = new ListAutomationsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setAutomations($automations);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new ListAutomationsRequest())
- ->setParent($formattedParent);
+ $request = (new ListAutomationsRequest())->setParent($formattedParent);
$response = $gapicClient->listAutomations($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -2696,17 +2823,19 @@ public function listAutomationsExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new ListAutomationsRequest())
- ->setParent($formattedParent);
+ $request = (new ListAutomationsRequest())->setParent($formattedParent);
try {
$gapicClient->listAutomations($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2731,17 +2860,14 @@ public function listCustomTargetTypesTest()
// Mock response
$nextPageToken = '';
$customTargetTypesElement = new CustomTargetType();
- $customTargetTypes = [
- $customTargetTypesElement,
- ];
+ $customTargetTypes = [$customTargetTypesElement];
$expectedResponse = new ListCustomTargetTypesResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setCustomTargetTypes($customTargetTypes);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListCustomTargetTypesRequest())
- ->setParent($formattedParent);
+ $request = (new ListCustomTargetTypesRequest())->setParent($formattedParent);
$response = $gapicClient->listCustomTargetTypes($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -2768,17 +2894,19 @@ public function listCustomTargetTypesExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListCustomTargetTypesRequest())
- ->setParent($formattedParent);
+ $request = (new ListCustomTargetTypesRequest())->setParent($formattedParent);
try {
$gapicClient->listCustomTargetTypes($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2803,17 +2931,14 @@ public function listDeliveryPipelinesTest()
// Mock response
$nextPageToken = '';
$deliveryPipelinesElement = new DeliveryPipeline();
- $deliveryPipelines = [
- $deliveryPipelinesElement,
- ];
+ $deliveryPipelines = [$deliveryPipelinesElement];
$expectedResponse = new ListDeliveryPipelinesResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setDeliveryPipelines($deliveryPipelines);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListDeliveryPipelinesRequest())
- ->setParent($formattedParent);
+ $request = (new ListDeliveryPipelinesRequest())->setParent($formattedParent);
$response = $gapicClient->listDeliveryPipelines($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -2840,17 +2965,19 @@ public function listDeliveryPipelinesExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListDeliveryPipelinesRequest())
- ->setParent($formattedParent);
+ $request = (new ListDeliveryPipelinesRequest())->setParent($formattedParent);
try {
$gapicClient->listDeliveryPipelines($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2875,17 +3002,20 @@ public function listJobRunsTest()
// Mock response
$nextPageToken = '';
$jobRunsElement = new JobRun();
- $jobRuns = [
- $jobRunsElement,
- ];
+ $jobRuns = [$jobRunsElement];
$expectedResponse = new ListJobRunsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setJobRuns($jobRuns);
$transport->addResponse($expectedResponse);
// Mock request
- $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $request = (new ListJobRunsRequest())
- ->setParent($formattedParent);
+ $formattedParent = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
+ $request = (new ListJobRunsRequest())->setParent($formattedParent);
$response = $gapicClient->listJobRuns($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -2912,17 +3042,25 @@ public function listJobRunsExceptionTest()
$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);
// Mock request
- $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $request = (new ListJobRunsRequest())
- ->setParent($formattedParent);
+ $formattedParent = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
+ $request = (new ListJobRunsRequest())->setParent($formattedParent);
try {
$gapicClient->listJobRuns($request);
// If the $gapicClient method call did not throw, fail the test
@@ -2947,17 +3085,14 @@ public function listReleasesTest()
// Mock response
$nextPageToken = '';
$releasesElement = new Release();
- $releases = [
- $releasesElement,
- ];
+ $releases = [$releasesElement];
$expectedResponse = new ListReleasesResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setReleases($releases);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new ListReleasesRequest())
- ->setParent($formattedParent);
+ $request = (new ListReleasesRequest())->setParent($formattedParent);
$response = $gapicClient->listReleases($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -2984,17 +3119,19 @@ public function listReleasesExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $request = (new ListReleasesRequest())
- ->setParent($formattedParent);
+ $request = (new ListReleasesRequest())->setParent($formattedParent);
try {
$gapicClient->listReleases($request);
// If the $gapicClient method call did not throw, fail the test
@@ -3019,17 +3156,14 @@ public function listRolloutsTest()
// Mock response
$nextPageToken = '';
$rolloutsElement = new Rollout();
- $rollouts = [
- $rolloutsElement,
- ];
+ $rollouts = [$rolloutsElement];
$expectedResponse = new ListRolloutsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setRollouts($rollouts);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new ListRolloutsRequest())
- ->setParent($formattedParent);
+ $request = (new ListRolloutsRequest())->setParent($formattedParent);
$response = $gapicClient->listRollouts($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -3056,17 +3190,19 @@ public function listRolloutsExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new ListRolloutsRequest())
- ->setParent($formattedParent);
+ $request = (new ListRolloutsRequest())->setParent($formattedParent);
try {
$gapicClient->listRollouts($request);
// If the $gapicClient method call did not throw, fail the test
@@ -3091,17 +3227,14 @@ public function listTargetsTest()
// Mock response
$nextPageToken = '';
$targetsElement = new Target();
- $targets = [
- $targetsElement,
- ];
+ $targets = [$targetsElement];
$expectedResponse = new ListTargetsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setTargets($targets);
$transport->addResponse($expectedResponse);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListTargetsRequest())
- ->setParent($formattedParent);
+ $request = (new ListTargetsRequest())->setParent($formattedParent);
$response = $gapicClient->listTargets($request);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
@@ -3128,17 +3261,19 @@ public function listTargetsExceptionTest()
$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);
// Mock request
$formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $request = (new ListTargetsRequest())
- ->setParent($formattedParent);
+ $request = (new ListTargetsRequest())->setParent($formattedParent);
try {
$gapicClient->listTargets($request);
// If the $gapicClient method call did not throw, fail the test
@@ -3164,7 +3299,13 @@ public function retryJobTest()
$expectedResponse = new RetryJobResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedRollout = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$phaseId = 'phaseId-1676299681';
$jobId = 'jobId-1154752291';
$request = (new RetryJobRequest())
@@ -3198,15 +3339,24 @@ public function retryJobExceptionTest()
$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);
// Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
+ $formattedRollout = $gapicClient->rolloutName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]'
+ );
$phaseId = 'phaseId-1676299681';
$jobId = 'jobId-1154752291';
$request = (new RetryJobRequest())
@@ -3272,12 +3422,15 @@ public function rollbackTargetExceptionTest()
$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);
// Mock request
$formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
@@ -3312,9 +3465,15 @@ public function terminateJobRunTest()
$expectedResponse = new TerminateJobRunResponse();
$transport->addResponse($expectedResponse);
// Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- $request = (new TerminateJobRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->jobRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]',
+ '[JOB_RUN]'
+ );
+ $request = (new TerminateJobRunRequest())->setName($formattedName);
$response = $gapicClient->terminateJobRun($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -3338,17 +3497,26 @@ public function terminateJobRunExceptionTest()
$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);
// Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- $request = (new TerminateJobRunRequest())
- ->setName($formattedName);
+ $formattedName = $gapicClient->jobRunName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DELIVERY_PIPELINE]',
+ '[RELEASE]',
+ '[ROLLOUT]',
+ '[JOB_RUN]'
+ );
+ $request = (new TerminateJobRunRequest())->setName($formattedName);
try {
$gapicClient->terminateJobRun($request);
// If the $gapicClient method call did not throw, fail the test
@@ -3412,9 +3580,7 @@ public function updateAutomationTest()
$automation->setSelector($automationSelector);
$automationRules = [];
$automation->setRules($automationRules);
- $request = (new UpdateAutomationRequest())
- ->setUpdateMask($updateMask)
- ->setAutomation($automation);
+ $request = (new UpdateAutomationRequest())->setUpdateMask($updateMask)->setAutomation($automation);
$response = $gapicClient->updateAutomation($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -3472,12 +3638,15 @@ public function updateAutomationExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$updateMask = new FieldMask();
@@ -3488,9 +3657,7 @@ public function updateAutomationExceptionTest()
$automation->setSelector($automationSelector);
$automationRules = [];
$automation->setRules($automationRules);
- $request = (new UpdateAutomationRequest())
- ->setUpdateMask($updateMask)
- ->setAutomation($automation);
+ $request = (new UpdateAutomationRequest())->setUpdateMask($updateMask)->setAutomation($automation);
$response = $gapicClient->updateAutomation($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -3615,12 +3782,15 @@ public function updateCustomTargetTypeExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$updateMask = new FieldMask();
@@ -3752,12 +3922,15 @@ public function updateDeliveryPipelineExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$updateMask = new FieldMask();
@@ -3831,9 +4004,7 @@ public function updateTargetTest()
// Mock request
$updateMask = new FieldMask();
$target = new Target();
- $request = (new UpdateTargetRequest())
- ->setUpdateMask($updateMask)
- ->setTarget($target);
+ $request = (new UpdateTargetRequest())->setUpdateMask($updateMask)->setTarget($target);
$response = $gapicClient->updateTarget($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -3891,19 +4062,20 @@ public function updateTargetExceptionTest()
$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
+ );
$operationsTransport->addResponse(null, $status);
// Mock request
$updateMask = new FieldMask();
$target = new Target();
- $request = (new UpdateTargetRequest())
- ->setUpdateMask($updateMask)
- ->setTarget($target);
+ $request = (new UpdateTargetRequest())->setUpdateMask($updateMask)->setTarget($target);
$response = $gapicClient->updateTarget($request);
$this->assertFalse($response->isDone());
$this->assertNull($response->getResult());
@@ -3965,12 +4137,15 @@ public function getLocationExceptionTest()
$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 GetLocationRequest();
try {
@@ -3997,9 +4172,7 @@ public function listLocationsTest()
// Mock response
$nextPageToken = '';
$locationsElement = new Location();
- $locations = [
- $locationsElement,
- ];
+ $locations = [$locationsElement];
$expectedResponse = new ListLocationsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
$expectedResponse->setLocations($locations);
@@ -4029,12 +4202,15 @@ public function listLocationsExceptionTest()
$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 ListLocationsRequest();
try {
@@ -4067,8 +4243,7 @@ public function getIamPolicyTest()
$transport->addResponse($expectedResponse);
// Mock request
$resource = 'resource-341064690';
- $request = (new GetIamPolicyRequest())
- ->setResource($resource);
+ $request = (new GetIamPolicyRequest())->setResource($resource);
$response = $gapicClient->getIamPolicy($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -4092,17 +4267,19 @@ public function getIamPolicyExceptionTest()
$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);
// Mock request
$resource = 'resource-341064690';
- $request = (new GetIamPolicyRequest())
- ->setResource($resource);
+ $request = (new GetIamPolicyRequest())->setResource($resource);
try {
$gapicClient->getIamPolicy($request);
// If the $gapicClient method call did not throw, fail the test
@@ -4134,9 +4311,7 @@ public function setIamPolicyTest()
// Mock request
$resource = 'resource-341064690';
$policy = new Policy();
- $request = (new SetIamPolicyRequest())
- ->setResource($resource)
- ->setPolicy($policy);
+ $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy);
$response = $gapicClient->setIamPolicy($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -4162,19 +4337,20 @@ public function setIamPolicyExceptionTest()
$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);
// Mock request
$resource = 'resource-341064690';
$policy = new Policy();
- $request = (new SetIamPolicyRequest())
- ->setResource($resource)
- ->setPolicy($policy);
+ $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy);
try {
$gapicClient->setIamPolicy($request);
// If the $gapicClient method call did not throw, fail the test
@@ -4202,9 +4378,7 @@ public function testIamPermissionsTest()
// Mock request
$resource = 'resource-341064690';
$permissions = [];
- $request = (new TestIamPermissionsRequest())
- ->setResource($resource)
- ->setPermissions($permissions);
+ $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions);
$response = $gapicClient->testIamPermissions($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -4230,19 +4404,20 @@ public function testIamPermissionsExceptionTest()
$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);
// Mock request
$resource = 'resource-341064690';
$permissions = [];
- $request = (new TestIamPermissionsRequest())
- ->setResource($resource)
- ->setPermissions($permissions);
+ $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions);
try {
$gapicClient->testIamPermissions($request);
// If the $gapicClient method call did not throw, fail the test
@@ -4269,8 +4444,7 @@ public function abandonReleaseAsyncTest()
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $request = (new AbandonReleaseRequest())
- ->setName($formattedName);
+ $request = (new AbandonReleaseRequest())->setName($formattedName);
$response = $gapicClient->abandonReleaseAsync($request)->wait();
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
diff --git a/Deploy/tests/Unit/V1/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/CloudDeployClientTest.php
deleted file mode 100644
index 3cd55d0cd3c8..000000000000
--- a/Deploy/tests/Unit/V1/CloudDeployClientTest.php
+++ /dev/null
@@ -1,3985 +0,0 @@
-getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock();
- }
-
- /** @return CloudDeployClient */
- private function createClient(array $options = [])
- {
- $options += [
- 'credentials' => $this->createCredentials(),
- ];
- return new CloudDeployClient($options);
- }
-
- /** @test */
- public function abandonReleaseTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new AbandonReleaseResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $response = $gapicClient->abandonRelease($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/AbandonRelease', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function abandonReleaseExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- try {
- $gapicClient->abandonRelease($formattedName);
- // 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 advanceRolloutTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new AdvanceRolloutResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $phaseId = 'phaseId-1676299681';
- $response = $gapicClient->advanceRollout($formattedName, $phaseId);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/AdvanceRollout', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $actualValue = $actualRequestObject->getPhaseId();
- $this->assertProtobufEquals($phaseId, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function advanceRolloutExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $phaseId = 'phaseId-1676299681';
- try {
- $gapicClient->advanceRollout($formattedName, $phaseId);
- // 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 approveRolloutTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new ApproveRolloutResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $approved = false;
- $response = $gapicClient->approveRollout($formattedName, $approved);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ApproveRollout', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $actualValue = $actualRequestObject->getApproved();
- $this->assertProtobufEquals($approved, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function approveRolloutExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $approved = false;
- try {
- $gapicClient->approveRollout($formattedName, $approved);
- // 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 cancelAutomationRunTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new CancelAutomationRunResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- $response = $gapicClient->cancelAutomationRun($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CancelAutomationRun', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function cancelAutomationRunExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- try {
- $gapicClient->cancelAutomationRun($formattedName);
- // 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 cancelRolloutTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new CancelRolloutResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $response = $gapicClient->cancelRollout($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CancelRollout', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function cancelRolloutExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- try {
- $gapicClient->cancelRollout($formattedName);
- // 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 createAutomationTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createAutomationTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $suspended = false;
- $serviceAccount = 'serviceAccount-1948028253';
- $expectedResponse = new Automation();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSuspended($suspended);
- $expectedResponse->setServiceAccount($serviceAccount);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createAutomationTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $automationId = 'automationId1989390659';
- $automation = new Automation();
- $automationServiceAccount = 'automationServiceAccount-192216401';
- $automation->setServiceAccount($automationServiceAccount);
- $automationSelector = new AutomationResourceSelector();
- $automation->setSelector($automationSelector);
- $automationRules = [];
- $automation->setRules($automationRules);
- $response = $gapicClient->createAutomation($formattedParent, $automationId, $automation);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateAutomation', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getAutomationId();
- $this->assertProtobufEquals($automationId, $actualValue);
- $actualValue = $actualApiRequestObject->getAutomation();
- $this->assertProtobufEquals($automation, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createAutomationTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createAutomationExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createAutomationTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $automationId = 'automationId1989390659';
- $automation = new Automation();
- $automationServiceAccount = 'automationServiceAccount-192216401';
- $automation->setServiceAccount($automationServiceAccount);
- $automationSelector = new AutomationResourceSelector();
- $automation->setSelector($automationSelector);
- $automationRules = [];
- $automation->setRules($automationRules);
- $response = $gapicClient->createAutomation($formattedParent, $automationId, $automation);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createAutomationTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createCustomTargetTypeTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createCustomTargetTypeTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $customTargetTypeId2 = 'customTargetTypeId2-1392620077';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $expectedResponse = new CustomTargetType();
- $expectedResponse->setName($name);
- $expectedResponse->setCustomTargetTypeId($customTargetTypeId2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createCustomTargetTypeTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $customTargetTypeId = 'customTargetTypeId-2048374240';
- $customTargetType = new CustomTargetType();
- $response = $gapicClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateCustomTargetType', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getCustomTargetTypeId();
- $this->assertProtobufEquals($customTargetTypeId, $actualValue);
- $actualValue = $actualApiRequestObject->getCustomTargetType();
- $this->assertProtobufEquals($customTargetType, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createCustomTargetTypeTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createCustomTargetTypeExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createCustomTargetTypeTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $customTargetTypeId = 'customTargetTypeId-2048374240';
- $customTargetType = new CustomTargetType();
- $response = $gapicClient->createCustomTargetType($formattedParent, $customTargetTypeId, $customTargetType);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createCustomTargetTypeTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createDeliveryPipelineTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createDeliveryPipelineTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $suspended = false;
- $expectedResponse = new DeliveryPipeline();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSuspended($suspended);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createDeliveryPipelineTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $deliveryPipelineId = 'deliveryPipelineId1972590605';
- $deliveryPipeline = new DeliveryPipeline();
- $response = $gapicClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateDeliveryPipeline', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getDeliveryPipelineId();
- $this->assertProtobufEquals($deliveryPipelineId, $actualValue);
- $actualValue = $actualApiRequestObject->getDeliveryPipeline();
- $this->assertProtobufEquals($deliveryPipeline, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createDeliveryPipelineTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createDeliveryPipelineExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createDeliveryPipelineTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $deliveryPipelineId = 'deliveryPipelineId1972590605';
- $deliveryPipeline = new DeliveryPipeline();
- $response = $gapicClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createDeliveryPipelineTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createReleaseTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createReleaseTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $abandoned = true;
- $skaffoldConfigUri = 'skaffoldConfigUri-860592176';
- $skaffoldConfigPath = 'skaffoldConfigPath-908718527';
- $etag = 'etag3123477';
- $skaffoldVersion = 'skaffoldVersion-1146663017';
- $expectedResponse = new Release();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setAbandoned($abandoned);
- $expectedResponse->setSkaffoldConfigUri($skaffoldConfigUri);
- $expectedResponse->setSkaffoldConfigPath($skaffoldConfigPath);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSkaffoldVersion($skaffoldVersion);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createReleaseTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $releaseId = 'releaseId-1517127597';
- $release = new Release();
- $response = $gapicClient->createRelease($formattedParent, $releaseId, $release);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateRelease', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getReleaseId();
- $this->assertProtobufEquals($releaseId, $actualValue);
- $actualValue = $actualApiRequestObject->getRelease();
- $this->assertProtobufEquals($release, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createReleaseTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createReleaseExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createReleaseTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $releaseId = 'releaseId-1517127597';
- $release = new Release();
- $response = $gapicClient->createRelease($formattedParent, $releaseId, $release);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createReleaseTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createRolloutTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createRolloutTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $targetId = 'targetId-815576439';
- $failureReason = 'failureReason1743941273';
- $deployingBuild = 'deployingBuild931623626';
- $etag = 'etag3123477';
- $controllerRollout = 'controllerRollout-146558962';
- $rollbackOfRollout = 'rollbackOfRollout-1880699004';
- $expectedResponse = new Rollout();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setTargetId($targetId);
- $expectedResponse->setFailureReason($failureReason);
- $expectedResponse->setDeployingBuild($deployingBuild);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setControllerRollout($controllerRollout);
- $expectedResponse->setRollbackOfRollout($rollbackOfRollout);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createRolloutTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $rolloutId = 'rolloutId-91142551';
- $rollout = new Rollout();
- $rolloutTargetId = 'rolloutTargetId509050717';
- $rollout->setTargetId($rolloutTargetId);
- $response = $gapicClient->createRollout($formattedParent, $rolloutId, $rollout);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateRollout', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getRolloutId();
- $this->assertProtobufEquals($rolloutId, $actualValue);
- $actualValue = $actualApiRequestObject->getRollout();
- $this->assertProtobufEquals($rollout, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createRolloutTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createRolloutExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createRolloutTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $rolloutId = 'rolloutId-91142551';
- $rollout = new Rollout();
- $rolloutTargetId = 'rolloutTargetId509050717';
- $rollout->setTargetId($rolloutTargetId);
- $response = $gapicClient->createRollout($formattedParent, $rolloutId, $rollout);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createRolloutTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createTargetTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createTargetTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $targetId2 = 'targetId2-2084907012';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $requireApproval = false;
- $etag = 'etag3123477';
- $expectedResponse = new Target();
- $expectedResponse->setName($name);
- $expectedResponse->setTargetId($targetId2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setRequireApproval($requireApproval);
- $expectedResponse->setEtag($etag);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/createTargetTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $targetId = 'targetId-815576439';
- $target = new Target();
- $response = $gapicClient->createTarget($formattedParent, $targetId, $target);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateTarget', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualApiRequestObject->getTargetId();
- $this->assertProtobufEquals($targetId, $actualValue);
- $actualValue = $actualApiRequestObject->getTarget();
- $this->assertProtobufEquals($target, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createTargetTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function createTargetExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/createTargetTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $targetId = 'targetId-815576439';
- $target = new Target();
- $response = $gapicClient->createTarget($formattedParent, $targetId, $target);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/createTargetTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteAutomationTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteAutomationTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $expectedResponse = new GPBEmpty();
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/deleteAutomationTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $response = $gapicClient->deleteAutomation($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteAutomation', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteAutomationTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteAutomationExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteAutomationTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $response = $gapicClient->deleteAutomation($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteAutomationTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteCustomTargetTypeTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteCustomTargetTypeTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $expectedResponse = new GPBEmpty();
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/deleteCustomTargetTypeTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $response = $gapicClient->deleteCustomTargetType($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteCustomTargetType', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteCustomTargetTypeTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteCustomTargetTypeExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteCustomTargetTypeTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $response = $gapicClient->deleteCustomTargetType($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteCustomTargetTypeTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteDeliveryPipelineTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteDeliveryPipelineTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $expectedResponse = new GPBEmpty();
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/deleteDeliveryPipelineTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $response = $gapicClient->deleteDeliveryPipeline($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteDeliveryPipelineExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteDeliveryPipelineTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $response = $gapicClient->deleteDeliveryPipeline($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteTargetTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteTargetTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $expectedResponse = new GPBEmpty();
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/deleteTargetTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $response = $gapicClient->deleteTarget($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteTargetTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function deleteTargetExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/deleteTargetTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $response = $gapicClient->deleteTarget($formattedName);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/deleteTargetTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function getAutomationTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $suspended = false;
- $serviceAccount = 'serviceAccount-1948028253';
- $expectedResponse = new Automation();
- $expectedResponse->setName($name2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSuspended($suspended);
- $expectedResponse->setServiceAccount($serviceAccount);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- $response = $gapicClient->getAutomation($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetAutomation', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getAutomationExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]');
- try {
- $gapicClient->getAutomation($formattedName);
- // 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 getAutomationRunTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $etag = 'etag3123477';
- $serviceAccount = 'serviceAccount-1948028253';
- $targetId = 'targetId-815576439';
- $stateDescription = 'stateDescription1692226894';
- $ruleId = 'ruleId1548659006';
- $automationId = 'automationId1989390659';
- $expectedResponse = new AutomationRun();
- $expectedResponse->setName($name2);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setServiceAccount($serviceAccount);
- $expectedResponse->setTargetId($targetId);
- $expectedResponse->setStateDescription($stateDescription);
- $expectedResponse->setRuleId($ruleId);
- $expectedResponse->setAutomationId($automationId);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- $response = $gapicClient->getAutomationRun($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetAutomationRun', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getAutomationRunExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]');
- try {
- $gapicClient->getAutomationRun($formattedName);
- // 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 getConfigTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837';
- $expectedResponse = new Config();
- $expectedResponse->setName($name2);
- $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]');
- $response = $gapicClient->getConfig($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getConfigExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]');
- try {
- $gapicClient->getConfig($formattedName);
- // 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 getCustomTargetTypeTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $customTargetTypeId = 'customTargetTypeId-2048374240';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $expectedResponse = new CustomTargetType();
- $expectedResponse->setName($name2);
- $expectedResponse->setCustomTargetTypeId($customTargetTypeId);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- $response = $gapicClient->getCustomTargetType($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetCustomTargetType', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getCustomTargetTypeExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->customTargetTypeName('[PROJECT]', '[LOCATION]', '[CUSTOM_TARGET_TYPE]');
- try {
- $gapicClient->getCustomTargetType($formattedName);
- // 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 getDeliveryPipelineTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $suspended = false;
- $expectedResponse = new DeliveryPipeline();
- $expectedResponse->setName($name2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSuspended($suspended);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $response = $gapicClient->getDeliveryPipeline($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetDeliveryPipeline', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getDeliveryPipelineExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- try {
- $gapicClient->getDeliveryPipeline($formattedName);
- // 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 getJobRunTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $uid = 'uid115792';
- $phaseId = 'phaseId-1676299681';
- $jobId = 'jobId-1154752291';
- $etag = 'etag3123477';
- $expectedResponse = new JobRun();
- $expectedResponse->setName($name2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setPhaseId($phaseId);
- $expectedResponse->setJobId($jobId);
- $expectedResponse->setEtag($etag);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- $response = $gapicClient->getJobRun($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetJobRun', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getJobRunExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- try {
- $gapicClient->getJobRun($formattedName);
- // 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 getReleaseTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $abandoned = true;
- $skaffoldConfigUri = 'skaffoldConfigUri-860592176';
- $skaffoldConfigPath = 'skaffoldConfigPath-908718527';
- $etag = 'etag3123477';
- $skaffoldVersion = 'skaffoldVersion-1146663017';
- $expectedResponse = new Release();
- $expectedResponse->setName($name2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setAbandoned($abandoned);
- $expectedResponse->setSkaffoldConfigUri($skaffoldConfigUri);
- $expectedResponse->setSkaffoldConfigPath($skaffoldConfigPath);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSkaffoldVersion($skaffoldVersion);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $response = $gapicClient->getRelease($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetRelease', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getReleaseExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- try {
- $gapicClient->getRelease($formattedName);
- // 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 getRolloutTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $targetId = 'targetId-815576439';
- $failureReason = 'failureReason1743941273';
- $deployingBuild = 'deployingBuild931623626';
- $etag = 'etag3123477';
- $controllerRollout = 'controllerRollout-146558962';
- $rollbackOfRollout = 'rollbackOfRollout-1880699004';
- $expectedResponse = new Rollout();
- $expectedResponse->setName($name2);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setTargetId($targetId);
- $expectedResponse->setFailureReason($failureReason);
- $expectedResponse->setDeployingBuild($deployingBuild);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setControllerRollout($controllerRollout);
- $expectedResponse->setRollbackOfRollout($rollbackOfRollout);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $response = $gapicClient->getRollout($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetRollout', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getRolloutExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- try {
- $gapicClient->getRollout($formattedName);
- // 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 getTargetTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $targetId = 'targetId-815576439';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $requireApproval = false;
- $etag = 'etag3123477';
- $expectedResponse = new Target();
- $expectedResponse->setName($name2);
- $expectedResponse->setTargetId($targetId);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setRequireApproval($requireApproval);
- $expectedResponse->setEtag($etag);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- $response = $gapicClient->getTarget($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetTarget', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getTargetExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]');
- try {
- $gapicClient->getTarget($formattedName);
- // 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 ignoreJobTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new IgnoreJobResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $phaseId = 'phaseId-1676299681';
- $jobId = 'jobId-1154752291';
- $response = $gapicClient->ignoreJob($formattedRollout, $phaseId, $jobId);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/IgnoreJob', $actualFuncCall);
- $actualValue = $actualRequestObject->getRollout();
- $this->assertProtobufEquals($formattedRollout, $actualValue);
- $actualValue = $actualRequestObject->getPhaseId();
- $this->assertProtobufEquals($phaseId, $actualValue);
- $actualValue = $actualRequestObject->getJobId();
- $this->assertProtobufEquals($jobId, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function ignoreJobExceptionTest()
- {
- $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);
- // Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $phaseId = 'phaseId-1676299681';
- $jobId = 'jobId-1154752291';
- try {
- $gapicClient->ignoreJob($formattedRollout, $phaseId, $jobId);
- // 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 listAutomationRunsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $automationRunsElement = new AutomationRun();
- $automationRuns = [
- $automationRunsElement,
- ];
- $expectedResponse = new ListAutomationRunsResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setAutomationRuns($automationRuns);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $response = $gapicClient->listAutomationRuns($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getAutomationRuns()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomationRuns', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listAutomationRunsExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- try {
- $gapicClient->listAutomationRuns($formattedParent);
- // 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 listAutomationsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $automationsElement = new Automation();
- $automations = [
- $automationsElement,
- ];
- $expectedResponse = new ListAutomationsResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setAutomations($automations);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $response = $gapicClient->listAutomations($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getAutomations()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomations', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listAutomationsExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- try {
- $gapicClient->listAutomations($formattedParent);
- // 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 listCustomTargetTypesTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $customTargetTypesElement = new CustomTargetType();
- $customTargetTypes = [
- $customTargetTypesElement,
- ];
- $expectedResponse = new ListCustomTargetTypesResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setCustomTargetTypes($customTargetTypes);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $response = $gapicClient->listCustomTargetTypes($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getCustomTargetTypes()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListCustomTargetTypes', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listCustomTargetTypesExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- try {
- $gapicClient->listCustomTargetTypes($formattedParent);
- // 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 listDeliveryPipelinesTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $deliveryPipelinesElement = new DeliveryPipeline();
- $deliveryPipelines = [
- $deliveryPipelinesElement,
- ];
- $expectedResponse = new ListDeliveryPipelinesResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setDeliveryPipelines($deliveryPipelines);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $response = $gapicClient->listDeliveryPipelines($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getDeliveryPipelines()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListDeliveryPipelines', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listDeliveryPipelinesExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- try {
- $gapicClient->listDeliveryPipelines($formattedParent);
- // 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 listJobRunsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $jobRunsElement = new JobRun();
- $jobRuns = [
- $jobRunsElement,
- ];
- $expectedResponse = new ListJobRunsResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setJobRuns($jobRuns);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $response = $gapicClient->listJobRuns($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getJobRuns()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListJobRuns', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listJobRunsExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- try {
- $gapicClient->listJobRuns($formattedParent);
- // 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 listReleasesTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $releasesElement = new Release();
- $releases = [
- $releasesElement,
- ];
- $expectedResponse = new ListReleasesResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setReleases($releases);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $response = $gapicClient->listReleases($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getReleases()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListReleases', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listReleasesExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- try {
- $gapicClient->listReleases($formattedParent);
- // 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 listRolloutsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $rolloutsElement = new Rollout();
- $rollouts = [
- $rolloutsElement,
- ];
- $expectedResponse = new ListRolloutsResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setRollouts($rollouts);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- $response = $gapicClient->listRollouts($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getRollouts()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListRollouts', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listRolloutsExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]');
- try {
- $gapicClient->listRollouts($formattedParent);
- // 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 listTargetsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $targetsElement = new Target();
- $targets = [
- $targetsElement,
- ];
- $expectedResponse = new ListTargetsResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setTargets($targets);
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $response = $gapicClient->listTargets($formattedParent);
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getTargets()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListTargets', $actualFuncCall);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listTargetsExceptionTest()
- {
- $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);
- // Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- try {
- $gapicClient->listTargets($formattedParent);
- // 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 retryJobTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new RetryJobResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $phaseId = 'phaseId-1676299681';
- $jobId = 'jobId-1154752291';
- $response = $gapicClient->retryJob($formattedRollout, $phaseId, $jobId);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/RetryJob', $actualFuncCall);
- $actualValue = $actualRequestObject->getRollout();
- $this->assertProtobufEquals($formattedRollout, $actualValue);
- $actualValue = $actualRequestObject->getPhaseId();
- $this->assertProtobufEquals($phaseId, $actualValue);
- $actualValue = $actualRequestObject->getJobId();
- $this->assertProtobufEquals($jobId, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function retryJobExceptionTest()
- {
- $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);
- // Mock request
- $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]');
- $phaseId = 'phaseId-1676299681';
- $jobId = 'jobId-1154752291';
- try {
- $gapicClient->retryJob($formattedRollout, $phaseId, $jobId);
- // 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 rollbackTargetTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new RollbackTargetResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $targetId = 'targetId-815576439';
- $rolloutId = 'rolloutId-91142551';
- $response = $gapicClient->rollbackTarget($formattedName, $targetId, $rolloutId);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/RollbackTarget', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $actualValue = $actualRequestObject->getTargetId();
- $this->assertProtobufEquals($targetId, $actualValue);
- $actualValue = $actualRequestObject->getRolloutId();
- $this->assertProtobufEquals($rolloutId, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function rollbackTargetExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]');
- $targetId = 'targetId-815576439';
- $rolloutId = 'rolloutId-91142551';
- try {
- $gapicClient->rollbackTarget($formattedName, $targetId, $rolloutId);
- // 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 terminateJobRunTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new TerminateJobRunResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- $response = $gapicClient->terminateJobRun($formattedName);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/TerminateJobRun', $actualFuncCall);
- $actualValue = $actualRequestObject->getName();
- $this->assertProtobufEquals($formattedName, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function terminateJobRunExceptionTest()
- {
- $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);
- // Mock request
- $formattedName = $gapicClient->jobRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]', '[JOB_RUN]');
- try {
- $gapicClient->terminateJobRun($formattedName);
- // 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 updateAutomationTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateAutomationTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $suspended = false;
- $serviceAccount = 'serviceAccount-1948028253';
- $expectedResponse = new Automation();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSuspended($suspended);
- $expectedResponse->setServiceAccount($serviceAccount);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/updateAutomationTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $updateMask = new FieldMask();
- $automation = new Automation();
- $automationServiceAccount = 'automationServiceAccount-192216401';
- $automation->setServiceAccount($automationServiceAccount);
- $automationSelector = new AutomationResourceSelector();
- $automation->setSelector($automationSelector);
- $automationRules = [];
- $automation->setRules($automationRules);
- $response = $gapicClient->updateAutomation($updateMask, $automation);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateAutomation', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getUpdateMask();
- $this->assertProtobufEquals($updateMask, $actualValue);
- $actualValue = $actualApiRequestObject->getAutomation();
- $this->assertProtobufEquals($automation, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateAutomationTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateAutomationExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateAutomationTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $updateMask = new FieldMask();
- $automation = new Automation();
- $automationServiceAccount = 'automationServiceAccount-192216401';
- $automation->setServiceAccount($automationServiceAccount);
- $automationSelector = new AutomationResourceSelector();
- $automation->setSelector($automationSelector);
- $automationRules = [];
- $automation->setRules($automationRules);
- $response = $gapicClient->updateAutomation($updateMask, $automation);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateAutomationTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateCustomTargetTypeTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateCustomTargetTypeTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $customTargetTypeId = 'customTargetTypeId-2048374240';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $expectedResponse = new CustomTargetType();
- $expectedResponse->setName($name);
- $expectedResponse->setCustomTargetTypeId($customTargetTypeId);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/updateCustomTargetTypeTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $updateMask = new FieldMask();
- $customTargetType = new CustomTargetType();
- $response = $gapicClient->updateCustomTargetType($updateMask, $customTargetType);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateCustomTargetType', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getUpdateMask();
- $this->assertProtobufEquals($updateMask, $actualValue);
- $actualValue = $actualApiRequestObject->getCustomTargetType();
- $this->assertProtobufEquals($customTargetType, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateCustomTargetTypeTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateCustomTargetTypeExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateCustomTargetTypeTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $updateMask = new FieldMask();
- $customTargetType = new CustomTargetType();
- $response = $gapicClient->updateCustomTargetType($updateMask, $customTargetType);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateCustomTargetTypeTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateDeliveryPipelineTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateDeliveryPipelineTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $etag = 'etag3123477';
- $suspended = false;
- $expectedResponse = new DeliveryPipeline();
- $expectedResponse->setName($name);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setEtag($etag);
- $expectedResponse->setSuspended($suspended);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/updateDeliveryPipelineTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $updateMask = new FieldMask();
- $deliveryPipeline = new DeliveryPipeline();
- $response = $gapicClient->updateDeliveryPipeline($updateMask, $deliveryPipeline);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateDeliveryPipeline', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getUpdateMask();
- $this->assertProtobufEquals($updateMask, $actualValue);
- $actualValue = $actualApiRequestObject->getDeliveryPipeline();
- $this->assertProtobufEquals($deliveryPipeline, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateDeliveryPipelineTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateDeliveryPipelineExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateDeliveryPipelineTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $updateMask = new FieldMask();
- $deliveryPipeline = new DeliveryPipeline();
- $response = $gapicClient->updateDeliveryPipeline($updateMask, $deliveryPipeline);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateDeliveryPipelineTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateTargetTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateTargetTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $name = 'name3373707';
- $targetId = 'targetId-815576439';
- $uid = 'uid115792';
- $description = 'description-1724546052';
- $requireApproval = false;
- $etag = 'etag3123477';
- $expectedResponse = new Target();
- $expectedResponse->setName($name);
- $expectedResponse->setTargetId($targetId);
- $expectedResponse->setUid($uid);
- $expectedResponse->setDescription($description);
- $expectedResponse->setRequireApproval($requireApproval);
- $expectedResponse->setEtag($etag);
- $anyResponse = new Any();
- $anyResponse->setValue($expectedResponse->serializeToString());
- $completeOperation = new Operation();
- $completeOperation->setName('operations/updateTargetTest');
- $completeOperation->setDone(true);
- $completeOperation->setResponse($anyResponse);
- $operationsTransport->addResponse($completeOperation);
- // Mock request
- $updateMask = new FieldMask();
- $target = new Target();
- $response = $gapicClient->updateTarget($updateMask, $target);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $apiRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($apiRequests));
- $operationsRequestsEmpty = $operationsTransport->popReceivedCalls();
- $this->assertSame(0, count($operationsRequestsEmpty));
- $actualApiFuncCall = $apiRequests[0]->getFuncCall();
- $actualApiRequestObject = $apiRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateTarget', $actualApiFuncCall);
- $actualValue = $actualApiRequestObject->getUpdateMask();
- $this->assertProtobufEquals($updateMask, $actualValue);
- $actualValue = $actualApiRequestObject->getTarget();
- $this->assertProtobufEquals($target, $actualValue);
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateTargetTest');
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- $this->assertTrue($response->isDone());
- $this->assertEquals($expectedResponse, $response->getResult());
- $apiRequestsEmpty = $transport->popReceivedCalls();
- $this->assertSame(0, count($apiRequestsEmpty));
- $operationsRequests = $operationsTransport->popReceivedCalls();
- $this->assertSame(1, count($operationsRequests));
- $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall();
- $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject();
- $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall);
- $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function updateTargetExceptionTest()
- {
- $operationsTransport = $this->createTransport();
- $operationsClient = new OperationsClient([
- 'apiEndpoint' => '',
- 'transport' => $operationsTransport,
- 'credentials' => $this->createCredentials(),
- ]);
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- 'operationsClient' => $operationsClient,
- ]);
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- // Mock response
- $incompleteOperation = new Operation();
- $incompleteOperation->setName('operations/updateTargetTest');
- $incompleteOperation->setDone(false);
- $transport->addResponse($incompleteOperation);
- $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);
- $operationsTransport->addResponse(null, $status);
- // Mock request
- $updateMask = new FieldMask();
- $target = new Target();
- $response = $gapicClient->updateTarget($updateMask, $target);
- $this->assertFalse($response->isDone());
- $this->assertNull($response->getResult());
- $expectedOperationsRequestObject = new GetOperationRequest();
- $expectedOperationsRequestObject->setName('operations/updateTargetTest');
- try {
- $response->pollUntilComplete([
- 'initialPollDelayMillis' => 1,
- ]);
- // If the pollUntilComplete() 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 stubs are exhausted
- $transport->popReceivedCalls();
- $operationsTransport->popReceivedCalls();
- $this->assertTrue($transport->isExhausted());
- $this->assertTrue($operationsTransport->isExhausted());
- }
-
- /** @test */
- public function getLocationTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $name2 = 'name2-1052831874';
- $locationId = 'locationId552319461';
- $displayName = 'displayName1615086568';
- $expectedResponse = new Location();
- $expectedResponse->setName($name2);
- $expectedResponse->setLocationId($locationId);
- $expectedResponse->setDisplayName($displayName);
- $transport->addResponse($expectedResponse);
- $response = $gapicClient->getLocation();
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getLocationExceptionTest()
- {
- $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->getLocation();
- // 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 listLocationsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $nextPageToken = '';
- $locationsElement = new Location();
- $locations = [
- $locationsElement,
- ];
- $expectedResponse = new ListLocationsResponse();
- $expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setLocations($locations);
- $transport->addResponse($expectedResponse);
- $response = $gapicClient->listLocations();
- $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
- $resources = iterator_to_array($response->iterateAllElements());
- $this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function listLocationsExceptionTest()
- {
- $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->listLocations();
- // 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 getIamPolicyTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $version = 351608024;
- $etag = '21';
- $expectedResponse = new Policy();
- $expectedResponse->setVersion($version);
- $expectedResponse->setEtag($etag);
- $transport->addResponse($expectedResponse);
- // Mock request
- $resource = 'resource-341064690';
- $response = $gapicClient->getIamPolicy($resource);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall);
- $actualValue = $actualRequestObject->getResource();
- $this->assertProtobufEquals($resource, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function getIamPolicyExceptionTest()
- {
- $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);
- // Mock request
- $resource = 'resource-341064690';
- try {
- $gapicClient->getIamPolicy($resource);
- // 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 setIamPolicyTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $version = 351608024;
- $etag = '21';
- $expectedResponse = new Policy();
- $expectedResponse->setVersion($version);
- $expectedResponse->setEtag($etag);
- $transport->addResponse($expectedResponse);
- // Mock request
- $resource = 'resource-341064690';
- $policy = new Policy();
- $response = $gapicClient->setIamPolicy($resource, $policy);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall);
- $actualValue = $actualRequestObject->getResource();
- $this->assertProtobufEquals($resource, $actualValue);
- $actualValue = $actualRequestObject->getPolicy();
- $this->assertProtobufEquals($policy, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function setIamPolicyExceptionTest()
- {
- $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);
- // Mock request
- $resource = 'resource-341064690';
- $policy = new Policy();
- try {
- $gapicClient->setIamPolicy($resource, $policy);
- // 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 testIamPermissionsTest()
- {
- $transport = $this->createTransport();
- $gapicClient = $this->createClient([
- 'transport' => $transport,
- ]);
- $this->assertTrue($transport->isExhausted());
- // Mock response
- $expectedResponse = new TestIamPermissionsResponse();
- $transport->addResponse($expectedResponse);
- // Mock request
- $resource = 'resource-341064690';
- $permissions = [];
- $response = $gapicClient->testIamPermissions($resource, $permissions);
- $this->assertEquals($expectedResponse, $response);
- $actualRequests = $transport->popReceivedCalls();
- $this->assertSame(1, count($actualRequests));
- $actualFuncCall = $actualRequests[0]->getFuncCall();
- $actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall);
- $actualValue = $actualRequestObject->getResource();
- $this->assertProtobufEquals($resource, $actualValue);
- $actualValue = $actualRequestObject->getPermissions();
- $this->assertProtobufEquals($permissions, $actualValue);
- $this->assertTrue($transport->isExhausted());
- }
-
- /** @test */
- public function testIamPermissionsExceptionTest()
- {
- $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);
- // Mock request
- $resource = 'resource-341064690';
- $permissions = [];
- try {
- $gapicClient->testIamPermissions($resource, $permissions);
- // 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());
- }
-}